Commit 0fbff1e4 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor hack to find a top file since assign used to put the pid number

in the name. I changed that, but in the meantime search for top file.
Also redirect stderr to /dev/null when generating gif for the web page
since it will mess up the gif image.
parent af58871e
......@@ -123,12 +123,43 @@ if (! chdir("$expt_path/$tbdata")) {
}
#
# Run the vis script and be done with it.
# XXX Temp Hack! Find a top file.
#
my $topfile = "$eid.top";
if (! -e $topfile) {
opendir(DIR, ".");
my @tops = grep { /^.*\.top/ && -f "$_" } readdir(DIR);
closedir DIR;
if (defined($tops[0])) {
$topfile = $tops[0];
# Must taint check!
if ($topfile =~ /^([-\@\w.\/]+)$/) {
$topfile = $1;
}
else {
die("*** $0:\n".
" Bad data in topfile name: $topfile");
}
}
else {
die("*** $0:\n".
" No topfile to graph!\n");
}
}
#
# Run the vis script and be done with it. We don't want stderr to go
# out with the gif file, so just kill that off if redirecting.
#
my $args = "$eid.top";
my $args = $topfile;
if (defined($output)) {
$args = "-o $output $args";
}
else {
$args = "$args 2> /dev/null";
}
if (system("$top2gif $args") != 0) {
exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment