From 30e07abae3b9d93c1ef29037c7ed42307fcfd995 Mon Sep 17 00:00:00 2001 From: Ace Jones Date: Thu, 24 Dec 2009 21:28:41 +0100 Subject: [PATCH] Check chdir() return value to silence a warning --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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());