plugind: dup() faileure check added.
authorAmarnath Valluri <amarnath.valluri@linux.intel.com>
Wed, 12 Jun 2013 13:15:58 +0000 (16:15 +0300)
committerAmarnath Valluri <amarnath.valluri@linux.intel.com>
Wed, 12 Jun 2013 13:15:58 +0000 (16:15 +0300)
src/daemon/plugins/plugind/main.c

index 31ba689..2c0bfd7 100644 (file)
@@ -119,6 +119,10 @@ int main (int argc, char **argv)
     }
 
     out_fd = dup(1);
+    if (out_fd == -1) {
+        WARN ("Failed to dup stdout : %s(%d)", strerror(errno), errno);
+        out_fd = 1;
+    }
 
     /* Reattach stderr to stdout */
     dup2 (2, 1);