[pisa-src] r1314 - trunk/libpisa/util.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 27 Oct 2009 14:22:37 +0100

Author: tjansen
Date: Tue Oct 27 14:22:36 2009
New Revision: 1314

Log:
Fixed warnings:

util.c: In function ‘pisa_daemonize’:
util.c:1169: warning: ignoring return value of ‘dup’, declared with attribute 
warn_unused_result
util.c:1170: warning: ignoring return value of ‘dup’, declared with attribute 
warn_unused_result

Modified:
   trunk/libpisa/util.c

Modified: trunk/libpisa/util.c
==============================================================================
--- trunk/libpisa/util.c        Tue Oct 27 14:17:14 2009        (r1313)
+++ trunk/libpisa/util.c        Tue Oct 27 14:22:36 2009        (r1314)
@@ -1165,9 +1165,12 @@
        close(0);
        close(1);
        close(2);
-       result = open("/dev/null", O_RDWR);
-       dup(result);
-       dup(result);
+       if ((result = open("/dev/null", O_RDWR)) != 0)
+               PISA_ERROR("pisa_daemonize: open STDIN failed.\n");
+       if (dup(result) != 1)
+               PISA_ERROR("pisa_daemonize: dup STDOUT failed.\n");
+       if (dup(result) != 2)
+               PISA_ERROR("pisa_daemonize: dup STDERR failed.\n");
 }
 
 /**

Other related posts:

  • » [pisa-src] r1314 - trunk/libpisa/util.c - Thomas Jansen