X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_config.c;h=19f690c7e8cd0d77d703b7adfcec3fcebb534db6;hb=cf9ffc8d9c02553b9698a795f26208fc121c8f1a;hp=51a91d009260db4b12a4710493818059863b9e56;hpb=aef6bb132ef2f5b4c446e42f6050033d4f5c177b;p=elogind.git diff --git a/udev_config.c b/udev_config.c index 51a91d009..19f690c7e 100644 --- a/udev_config.c +++ b/udev_config.c @@ -60,11 +60,15 @@ static int string_is_true(char *str) return 1; if (strcasecmp(str, "yes") == 0) return 1; + if (strcasecmp(str, "1") == 0) + return 1; return 0; } static void init_variables(void) { + char *env; + /* fill up the defaults. * If any config values are specified, they will * override these values. */ @@ -76,11 +80,13 @@ static void init_variables(void) udev_log = string_is_true(UDEV_LOG_DEFAULT); udev_sleep = 1; - if (getenv("UDEV_NO_SLEEP") != NULL) + env = getenv("UDEV_NO_SLEEP"); + if (env && string_is_true(env)) udev_sleep = 0; udev_dev_d = 1; - if (getenv("UDEV_NO_DEVD") != NULL) + env = getenv("UDEV_NO_DEVD"); + if (env && string_is_true(env)) udev_dev_d = 0; }