From 2d0c36f39ed2ffc61dbbb5ffbcb78ab348d5ec0a Mon Sep 17 00:00:00 2001 From: "mcafee%netscape.com" Date: Sun, 5 May 2002 08:50:14 +0000 Subject: [PATCH] Write out temp file with pid, to avoid race condition git-svn-id: svn://10.0.0.236/trunk@120797 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/graph/graph.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/graph/graph.cgi b/mozilla/webtools/graph/graph.cgi index 968ebbd6ffa..93ae976510f 100755 --- a/mozilla/webtools/graph/graph.cgi +++ b/mozilla/webtools/graph/graph.cgi @@ -164,11 +164,11 @@ sub show_graph { if($SHOWPOINT) { my @xy = split(",",$SHOWPOINT); - open POINTFILE, ">db/$TESTNAME/point.txt"; + open POINTFILE, ">db/$TESTNAME/point.$$"; print POINTFILE "$xy[0]\t$xy[1]\n"; close POINTFILE; - $plot_cmd .= ", \"db/$TESTNAME/point.txt\" using 1:2 with points ls 4"; + $plot_cmd .= ", \"db/$TESTNAME/point.$$\" using 1:2 with points ls 4"; } @@ -224,7 +224,7 @@ sub show_graph { # Cleanup generated files. if($SHOWPOINT) { - unlink("db/$TESTNAME/point.txt"); + unlink("db/$TESTNAME/point.$$"); } print "Content-type: image/png\n\n";