Fix ubuntu "ignoring return value" warnings.
[ccan] / ccan / daemonize / test / run.c
index 9802c44237c5c6da482adfc4bde692933229a61a..a471268d3ef172995fd4a0088cd70c9266c75383 100644 (file)
@@ -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);
        }