patch-clients_lcdproc_main_c 794 B

12345678910111213141516171819202122232425
  1. $OpenBSD: patch-clients_lcdproc_main_c,v 1.1.1.1 2011/12/01 19:05:11 edd Exp $
  2. Consistently log errors (further, stderr will be closed if daemonised).
  3. --- clients/lcdproc/main.c.orig Tue Nov 15 16:44:06 2011
  4. +++ clients/lcdproc/main.c Tue Nov 15 16:48:07 2011
  5. @@ -329,7 +329,7 @@ main(int argc, char **argv)
  6. if (foreground != TRUE) {
  7. if (daemon(1, 0) != 0) {
  8. - fprintf(stderr, "Error: daemonize failed\n");
  9. + report(RPT_CRIT, "Error: daemonize failed: %s", strerror(errno));
  10. return (EXIT_FAILURE);
  11. }
  12. @@ -342,7 +342,7 @@ main(int argc, char **argv)
  13. pidfile_written = TRUE;
  14. }
  15. else {
  16. - fprintf(stderr, "Error creating pidfile %s: %s\n",
  17. + report(RPT_CRIT, "Error creating pidfile %s: %s",
  18. pidfile, strerror(errno));
  19. return (EXIT_FAILURE);
  20. }