Browse Source

popen() requires pclose().

Guus Sliepen 17 years ago
parent
commit
0d1ac68c59
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/graph.c

+ 4 - 3
src/graph.c

@@ -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);
 	}