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 b5af2241f51b189b8fafd8268aa6c63112cee8f5..eadb36a7c9d8f6c9f40684943b4ecdbda68d30d5 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);
        }