aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/daemon.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/daemon.c b/src/daemon.c
index 43d16bc9b..5ae79e050 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -85,23 +85,13 @@ daemonize_kill(void)
exit(EXIT_SUCCESS);
}
-#endif
-
void
daemonize_close_stdin(void)
{
- int fd = open("/dev/null", O_RDONLY);
-
- if (fd < 0)
- close(STDIN_FILENO);
- else if (fd != STDIN_FILENO) {
- dup2(fd, STDIN_FILENO);
- close(fd);
- }
+ close(STDIN_FILENO);
+ open("/dev/null", O_RDONLY);
}
-#ifndef WIN32
-
void
daemonize_set_user(void)
{