Check chdir() return value to silence a warning

This commit is contained in:
Ace Jones 2009-12-24 21:28:41 +01:00 committed by Julien BLACHE
parent d231faff2d
commit 30e07abae3
1 changed files with 4 additions and 1 deletions

View File

@ -172,7 +172,10 @@ daemonize(int background, char *pidfile)
if (fd > 2) if (fd > 2)
close(fd); close(fd);
chdir("/"); ret = chdir("/");
if (ret < 0)
DPRINTF(E_WARN, L_MAIN, "chdir() failed: %s\n", strerror(errno));
umask(0); umask(0);
fprintf(fp, "%d\n", getpid()); fprintf(fp, "%d\n", getpid());