- Timestamp:
- Jun 1, 2026, 4:53:16 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/psmkreq
r40421 r43048 17 17 use File::Temp qw(tempfile); 18 18 use File::Basename qw(basename); 19 use Scalar::Util qw(looks_like_number); 19 20 use IPC::Cmd 0.36 qw( can_run run ); 20 21 use Carp; … … 295 296 my $command = "$pstamp_request_file --input $table_def_name --req_name $req_name"; 296 297 $command .= " --output $output" if $output; 297 my ( $success, $error_ code, $full_buf, $stdout_buf, $stderr_buf ) =298 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = 298 299 run(command => $command, verbose => $verbose); 300 my $error_code = &parse_error_message ($success, $error_msg, $command); 299 301 unless ($success) { 300 302 print STDERR @$stderr_buf; 301 exit $error_code >> 8;303 exit $error_code; 302 304 } 303 305 } … … 447 449 448 450 } 451 452 # if the program exited normally, the exit value is returned 453 # if the program exited with a signal (abort, crash, etc), PS_EXIT_PROG_ERROR (4) is returned 454 # if the program failed to run, -PS_EXIT_PROG_ERROR (-4) is returned 455 sub parse_error_message { 456 my $success = shift; 457 my $error_msg = shift; 458 my $command = shift; 459 460 if ($success) { return 0; } 461 462 print "raw error_msg: $error_msg\n"; 463 print "full command: $command\n"; 464 465 if (&looks_like_number($error_msg)) { return (($error_msg >> 8) or ($PS_EXIT_PROG_ERROR)); } 466 467 # which of these match? 468 my ($error_code) = $error_msg =~ m/exited with value (\d+)/; 469 if (defined $error_code) { return $error_code; } 470 471 ($error_code) = $error_msg =~ m/died with signal (\d+)/; 472 # if (defined $error_code) { return (128 + $error_code); } 473 if (defined $error_code) { return ($PS_EXIT_PROG_ERROR); } 474 475 # probably failed to execute: 476 return (-1*$PS_EXIT_PROG_ERROR); 477 } 478
Note:
See TracChangeset
for help on using the changeset viewer.
