summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2015-06-17 19:06:49 +0200
committerKay Sievers <kay@vrfy.org>2015-06-17 19:06:49 +0200
commit79b04ad7d40b128ac161d8773efd6860e3730863 (patch)
tree97b3dc7d43179b4bdbabec7713d23aa928a0fc8a /src
parent633f2d59edeb3aa9cf88454780d55fac2e4dbe8d (diff)
parent40e749b59ba49fb97c1f45859debe2a82bc9c9ef (diff)
Merge pull request #262 from teg/udev-dup-fds-2
udevd: daemon - connect /dev/null to std{in,out,err} in debug mode
Diffstat (limited to 'src')
-rw-r--r--src/udev/udevd.c5
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: