Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/usermode let env URKELVISOR=0 disable it a...



details:   https://anonhg.NetBSD.org/src/rev/cd9cd8d42374
branches:  trunk
changeset: 769276:cd9cd8d42374
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Sep 05 12:49:33 2011 +0000

description:
let env URKELVISOR=0 disable it at runtime

diffstat:

 sys/arch/usermode/usermode/urkelvisor.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 97dfcccc8ad7 -r cd9cd8d42374 sys/arch/usermode/usermode/urkelvisor.c
--- a/sys/arch/usermode/usermode/urkelvisor.c   Mon Sep 05 12:40:38 2011 +0000
+++ b/sys/arch/usermode/usermode/urkelvisor.c   Mon Sep 05 12:49:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: urkelvisor.c,v 1.3 2011/09/03 15:00:28 jmcneill Exp $ */
+/* $NetBSD: urkelvisor.c,v 1.4 2011/09/05 12:49:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __NetBSD__
-__RCSID("$NetBSD: urkelvisor.c,v 1.3 2011/09/03 15:00:28 jmcneill Exp $");
+__RCSID("$NetBSD: urkelvisor.c,v 1.4 2011/09/05 12:49:33 jmcneill Exp $");
 #endif
 
 #include <sys/types.h>
@@ -169,9 +169,17 @@
 void
 urkelvisor_init(void)
 {
+       char *enable;
        pid_t child_pid;
        int status;
 
+       /* env URKELVISOR=0 disables the urkelvisor */
+       enable = getenv("URKELVISOR");
+       if (enable && *enable == '0') {
+               fprintf(stderr, "%s: disabled\n", __func__);
+               return;
+       }
+
        child_pid = fork();
        switch (child_pid) {
        case -1:



Home | Main Index | Thread Index | Old Index