diff --git a/src/main.c b/src/main.c index 3027d033..4e9a3af3 100644 --- a/src/main.c +++ b/src/main.c @@ -172,7 +172,10 @@ daemonize(int background, char *pidfile) if (fd > 2) close(fd); - chdir("/"); + ret = chdir("/"); + if (ret < 0) + DPRINTF(E_WARN, L_MAIN, "chdir() failed: %s\n", strerror(errno)); + umask(0); fprintf(fp, "%d\n", getpid());