[Bio] / FigKernelPackages / Tracer.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Tracer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.126, Wed Dec 16 20:00:53 2009 UTC revision 1.129, Tue Jan 5 17:25:48 2010 UTC
# Line 1122  Line 1122 
1122      my $dest = $options{destType} || "WARN";      my $dest = $options{destType} || "WARN";
1123      # Check for emergency tracing.      # Check for emergency tracing.
1124      my $tkey = EmergencyKey($parameter);      my $tkey = EmergencyKey($parameter);
     warn "Tracing key is $tkey.\n"; ##HACK  
1125      my $emergencyFile = EmergencyFileName($tkey);      my $emergencyFile = EmergencyFileName($tkey);
1126      if (-e $emergencyFile) {      if (-e $emergencyFile && (my $stat = stat($emergencyFile))) {
1127          # We have the file. Read in the data.          # We have the file. Read in the data.
1128          my @tracing = GetFile($emergencyFile);          my @tracing = GetFile($emergencyFile);
1129          # Pull off the time limit.          # Pull off the time limit.
# Line 1132  Line 1131 
1131          # Convert it to seconds.          # Convert it to seconds.
1132          $expire *= 3600;          $expire *= 3600;
1133          # Check the file data.          # Check the file data.
         my $stat = stat($emergencyFile);  
1134          my ($now) = gettimeofday;          my ($now) = gettimeofday;
1135          if ($now - $stat->mtime > $expire) {          if ($now - $stat->mtime <= $expire) {
             # Delete the expired file.  
             unlink $emergencyFile;  
         } else {  
1136              # Emergency tracing is on. Pull off the destination and              # Emergency tracing is on. Pull off the destination and
1137              # the trace level;              # the trace level;
1138              $dest = shift @tracing;              $dest = shift @tracing;
# Line 1150  Line 1145 
1145          }          }
1146      }      }
1147      # Convert the destination to a real tracing destination.      # Convert the destination to a real tracing destination.
     warn "Tracing destination is $dest.\n"; ##HACK  
1148      $dest = EmergencyTracingDest($tkey, $dest);      $dest = EmergencyTracingDest($tkey, $dest);
1149      # Setup the tracing we've determined from all the stuff above.      # Setup the tracing we've determined from all the stuff above.
     warn "TSetup is \"$tracing\", \"$dest\".\n"; ##HACK  
1150      TSetup($tracing, $dest);      TSetup($tracing, $dest);
1151      # Check to see if we're a web script.      # Check to see if we're a web script.
1152      if (defined $SavedCGI) {      if (defined $SavedCGI) {
# Line 1351  Line 1344 
1344      # Declare the return variable.      # Declare the return variable.
1345      my $retVal;      my $retVal;
1346      # Determine the parameter type.      # Determine the parameter type.
1347      if (! defined $parameter || defined($ENV{TRACING})) {      if (! defined $parameter) {
1348          # Here we're supposed to check the environment. If that fails, we          # Here we're supposed to check the environment. If that fails, we
1349          # get the effective login ID.          # get the effective login ID.
1350          $retVal = $ENV{TRACING} || scalar getpwuid($<);          $retVal = $ENV{TRACING} || scalar getpwuid($<);

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.129

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3