diff options
author | Daniel Mack <github@zonque.org> | 2015-11-02 10:10:44 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-11-02 10:10:44 +0100 |
commit | d0744e54eb83a9f4e4f54a59de3905699a667be0 (patch) | |
tree | 67deec65f866186503d4a45c1197121625b159cb /src/basic/env-util.c | |
parent | 534e8f89d6367cd0e9e17fff67880fb430071d01 (diff) | |
parent | 3958325852869a5e490b5741016c93b8b9a80e11 (diff) |
Merge pull request #1745 from poettering/journal-deadlock
Make sure journald never blocks on sd_notify() to PID 1
Diffstat (limited to 'src/basic/env-util.c')
-rw-r--r-- | src/basic/env-util.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 94cb251698..9ddac5d6a1 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -25,6 +25,7 @@ #include "alloc-util.h" #include "def.h" #include "env-util.h" +#include "parse-util.h" #include "string-util.h" #include "strv.h" #include "utf8.h" @@ -594,3 +595,13 @@ char **replace_env_argv(char **argv, char **env) { ret[k] = NULL; return ret; } + +int getenv_bool(const char *p) { + const char *e; + + e = getenv(p); + if (!e) + return -ENXIO; + + return parse_boolean(e); +} |