Commit cd13fd53 authored by Rusty Russell's avatar Rusty Russell

Fix ubuntu "ignoring return value" warnings.

parent 501b31cd
...@@ -24,7 +24,9 @@ bool daemonize(void) ...@@ -24,7 +24,9 @@ bool daemonize(void)
/* Session leader so ^C doesn't whack us. */ /* Session leader so ^C doesn't whack us. */
setsid(); setsid();
/* Move off any mount points we might be in. */ /* Move off any mount points we might be in. */
chdir("/"); if (chdir("/") != 0)
return false;
/* Discard our parent's old-fashioned umask prejudices. */ /* Discard our parent's old-fashioned umask prejudices. */
umask(0); umask(0);
return true; return true;
......
...@@ -47,7 +47,9 @@ int main(int argc, char *argv[]) ...@@ -47,7 +47,9 @@ int main(int argc, char *argv[])
while (getppid() == pid) while (getppid() == pid)
sleep(1); sleep(1);
daemonized.ppid = getppid(); daemonized.ppid = getppid();
write(fds[1], &daemonized, sizeof(daemonized)); if (write(fds[1], &daemonized, sizeof(daemonized))
!= sizeof(daemonized))
exit(1);
exit(0); exit(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment