diff --git a/daemon.c b/daemon.c --- a/daemon.c +++ b/daemon.c @@ -32,7 +32,8 @@ strftime (time_stamp, sizeof (time_stamp), "%a %d %T", localtime (&t)); len = snprintf (response, sizeof (response), "%s %s", time_stamp, buffer); - write (fd, response, len); + if (write (fd, response, len) == -1) + perror ("write"); } void sigproc () @@ -80,7 +81,10 @@ sanity_check (argc, argv); - daemon (0, 0); + if (daemon (0, 0) == -1) { + perror ("daemon"); + return EXIT_FAILURE; + } signal (SIGTERM, sigproc); for (;;) {