popen() requires pclose().
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 11 Nov 2006 14:37:03 +0000 (14:37 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 11 Nov 2006 14:37:03 +0000 (14:37 +0000)
src/graph.c

index b5af224..eadb36a 100644 (file)
@@ -364,9 +364,10 @@ void dump_graph(void)
 
        fprintf(file, "}\n");   
        
-       fclose(file);
-
-       if(filename[0] != '|') {
+       if(filename[0] == '|') {
+               pclose(file);
+       } else {
+               fclose(file);
                rename(tmpname, filename);
                free(tmpname);
        }