]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_daemon.c: fix Coverity CID#13627 Unchecked return value from library
authorMarek Schimara <Marek.Schimara@bull.net>
Fri, 17 Jun 2016 11:33:55 +0000 (13:33 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:33 +0000 (16:32 +0200)
        CWE-252 / https://cwe.mitre.org/data/definitions/252.html

src/rrd_daemon.c

index 53d6a5506d073ce0cb9e0fbdb97f551639e7d7ca..87eb0520a84820908d48c071cd2a8760ea0d8953 100644 (file)
@@ -3838,7 +3838,9 @@ static int daemonize (void) /* {{{ */
     close (1);
     close (0);
 
-    open ("/dev/null", O_RDWR);
+    if (open ("/dev/null", O_RDWR) == -1) {
+      RRDD_LOG (LOG_ERR, "failed to open /dev/null.\n");
+    }
     if (dup(0) == -1 || dup(0) == -1){
         RRDD_LOG (LOG_ERR, "faild to run dup.\n");
     }