diff options
author | Tom Gundersen <teg@jklm.no> | 2015-06-17 17:43:11 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-06-17 18:07:20 +0200 |
commit | 40e749b59ba49fb97c1f45859debe2a82bc9c9ef (patch) | |
tree | 726a26e33aabc18a57dbaa6bda89e91b2c5bd189 /src/udev | |
parent | a54941f1b47507e1609f0d8eb224f5a5a5732c0e (diff) |
udevd: daemon - connect /dev/null to std{in,out,err} in debug mode
This is essentially a revert of 5c67cf2 and fixes issue #190.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 5ce11606c9..11f1f6372e 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -43,6 +43,7 @@ #include "sd-daemon.h" #include "sd-event.h" +#include "terminal-util.h" #include "signal-util.h" #include "event-util.h" #include "netlink-util.h" @@ -1687,6 +1688,10 @@ int main(int argc, char *argv[]) { log_info("starting version " VERSION); + /* connect /dev/null to stdin, stdout, stderr */ + if (log_get_max_level() < LOG_DEBUG) + (void) make_null_stdio(); + pid = fork(); switch (pid) { case 0: |