]> arthur.barton.de Git - netdata.git/blobdiff - src/popen.c
minor code cleanups; updated the dashboard to fix inline charts
[netdata.git] / src / popen.c
index 58dc1f549e519317b391ebaa2c2251972443280a..9449c64f42d6ced1c7950be8d25d94bd7e4c18b7 100755 (executable)
@@ -78,7 +78,7 @@ FILE *mypopen(const char *command, pid_t *pidptr)
 
        // close all files
        int i;
-       for(i = sysconf(_SC_OPEN_MAX); i > 0; i--)
+       for(i = sysconf(_SC_OPEN_MAX) - 1; i > 0; i--)
                if(i != STDIN_FILENO && i != STDERR_FILENO && i != pipefd[PIPE_WRITE]) close(i);
 
        // move the pipe to stdout