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
This commit is contained in:
mcafee%netscape.com 2002-05-05 08:50:14 +00:00
parent f40b288bff
commit 2d0c36f39e

View File

@ -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";