mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-03-01 00:00:00 +07:00
Revert "udev: don't close std{in,out,err}"
This reverts commitb2399d9b72
. 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:
parent
3c49a3776a
commit
7061de26fa
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user