From ff8d077d36a666cba38bf1509e4d55d8f2fd4812 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 7 Mar 2015 19:59:17 +0000 Subject: Don't redirect stdout in s6-devd --- src/minutils/s6-devd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/minutils/s6-devd.c b/src/minutils/s6-devd.c index 2e5c9ce..f51550c 100644 --- a/src/minutils/s6-devd.c +++ b/src/minutils/s6-devd.c @@ -241,15 +241,8 @@ int main (int argc, char const *const *argv, char const *const *envp) } argc -= l.ind ; argv += l.ind ; if (!argc) strerr_dieusage(100, USAGE) ; - { - int fd = open_readb("/dev/null") ; - if (fd < 0) strerr_diefu2sys(111, "open /dev/null for ", "reading") ; - if (fd_move(0, fd) < 0) strerr_diefu2sys(111, "redirect std", "in") ; - fd = open_write("/dev/null") ; - if (fd < 0) strerr_diefu2sys(111, "open /dev/null for ", "writing") ; - if (ndelay_off(fd) < 0) strerr_diefu1sys(111, "ndelay_off /dev/null") ; - if (fd_move(1, fd) < 0) strerr_diefu2sys(111, "redirect std", "out") ; - } + close(0) ; + if (open_readb("/dev/null") < 0) strerr_diefu1sys(111, "open /dev/null for reading") ; x[1].fd = netlink_init(kbufsz) ; if (x[1].fd < 0) strerr_diefu1sys(111, "init netlink") ; } -- cgit v1.2.3