Revert "udev: don't close std{in,out,err}"

This reverts commit b2399d9b72.

This solves issue #108.  While upstream also reverted this commit,
they did so using functions in terminal-util.c.  We could import
that file and those functions but for such a small commit, its not
worth it.   We may do so at some future time if there are further
gains.  See:

40e749b59b

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
Anthony G. Basile 2015-06-18 10:36:37 -04:00
parent 3c49a3776a
commit 7061de26fa

View File

@ -1277,6 +1277,18 @@ int main(int argc, char *argv[]) {
udev_list_node_init(&event_list);
if (!arg_debug) {
int fd;
fd = open("/dev/null", O_RDWR);
if (fd >= 0) {
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
close(fd);
}
}
fd_inotify = udev_watch_init(udev);
if (fd_inotify < 0) {
r = log_error_errno(ENOMEM, "error initializing inotify");