Fix compiler warnings

This commit is contained in:
Miroslav Lichvar
2012-02-27 16:08:14 +01:00
parent 15b6ab77ea
commit 2a305d8e16
2 changed files with 7 additions and 4 deletions

8
main.c
View File

@@ -259,6 +259,11 @@ go_daemon(void)
} else {
/* In the child we want to leave running as the daemon */
/* Change current directory to / */
if (chdir("/") < 0) {
LOG(LOGS_ERR, LOGF_Logging, "Could not chdir to / : %s", strerror(errno));
}
/* Don't keep stdin/out/err from before. But don't close
the parent pipe yet. */
for (fd=0; fd<1024; fd++) {
@@ -266,9 +271,6 @@ go_daemon(void)
close(fd);
}
/* Change current directory to / */
chdir("/");
LOG_SetParentFd(pipefd[1]);
}
}