diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-05 17:06:24 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-05 17:06:24 +0930 |
commit | cd13fd53487ba6f10b78ab1ffd625cb3da7ab22a (patch) | |
tree | a210c970b50cc043443449b50028fe9bc9deb35b | |
parent | 501b31cddfaa3e8a4374dc84f6f75d07dd2d0abb (diff) |
Fix ubuntu "ignoring return value" warnings.
-rw-r--r-- | ccan/daemonize/daemonize.c | 4 | ||||
-rw-r--r-- | ccan/daemonize/test/run.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/ccan/daemonize/daemonize.c b/ccan/daemonize/daemonize.c index 861b0fc7..ca4aafc8 100644 --- a/ccan/daemonize/daemonize.c +++ b/ccan/daemonize/daemonize.c @@ -24,7 +24,9 @@ bool daemonize(void) /* Session leader so ^C doesn't whack us. */ setsid(); /* Move off any mount points we might be in. */ - chdir("/"); + if (chdir("/") != 0) + return false; + /* Discard our parent's old-fashioned umask prejudices. */ umask(0); return true; diff --git a/ccan/daemonize/test/run.c b/ccan/daemonize/test/run.c index 9802c442..a471268d 100644 --- a/ccan/daemonize/test/run.c +++ b/ccan/daemonize/test/run.c @@ -47,7 +47,9 @@ int main(int argc, char *argv[]) while (getppid() == pid) sleep(1); daemonized.ppid = getppid(); - write(fds[1], &daemonized, sizeof(daemonized)); + if (write(fds[1], &daemonized, sizeof(daemonized)) + != sizeof(daemonized)) + exit(1); exit(0); } |