From d102ed4ed39d39cf3777825f795ee95e41407d71 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Wed, 23 Sep 2009 07:08:45 +0530 Subject: Don't ignore retval of chdir() --- src/daemon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/daemon.c b/src/daemon.c index 9a87d7a..e865ecf 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -24,6 +24,7 @@ #include "main.h" #include "daemon.h" +#include "log.h" /* * Fork a child process and then kill the parent so make the calling @@ -40,7 +41,11 @@ void makedaemon (void) if (fork () != 0) exit (0); - chdir ("/"); + if (chdir ("/") != 0) { + log_message (LOG_WARNING, + "Could not change directory to /"); + } + umask (0177); #if NDEBUG -- cgit v1.2.3