summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-31 22:38:30 +0200
committerTom Gundersen <teg@jklm.no>2015-05-31 22:38:39 +0200
commitf6fd40d16adbd0f9ddbb1f24b4b8734fd8790ad0 (patch)
treec6d821f1f404ae7fdc3849865f2ed574d8b42ef8 /src
parentd38e01dc96c5cae1986561c4f3bc7f760560bf2a (diff)
udevd: don't sanitize fd 0,1,2
Kay said: 'it is from ancient times, when we started udevd from the kernel's usermodhelper which had no fd 0,1,2'.
Diffstat (limited to 'src')
-rw-r--r--src/udev/udevd.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index fae8f7895d..c021e806a4 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1628,23 +1628,6 @@ int main(int argc, char *argv[]) {
log_debug("set children_max to %u", arg_children_max);
}
- /* before opening new files, make sure std{in,out,err} fds are in a sane state */
- if (arg_daemonize) {
- int fd;
-
- fd = open("/dev/null", O_RDWR);
- if (fd < 0)
- log_error("cannot open /dev/null");
- else {
- if (write(STDOUT_FILENO, 0, 0) < 0)
- dup2(fd, STDOUT_FILENO);
- if (write(STDERR_FILENO, 0, 0) < 0)
- dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO)
- close(fd);
- }
- }
-
/* set umask before creating any file/directory */
r = chdir("/");
if (r < 0) {