[padb-devel] [padb commit] r107 - Tidy up the error messages when the inner command dies unexpectadly,

codesite-noreply at google.com codesite-noreply at google.com
Wed Jul 15 21:00:39 BST 2009


Author: apittman
Date: Wed Jul 15 13:00:25 2009
New Revision: 107

Modified:
    branches/full-duplex/src/padb

Log:
Tidy up the error messages when the inner command dies unexpectadly,
firstly print a warning if we didn't expect it to exit and also print
more meaningfull information when there is an error.


Modified: branches/full-duplex/src/padb
==============================================================================
--- branches/full-duplex/src/padb	(original)
+++ branches/full-duplex/src/padb	Wed Jul 15 13:00:25 2009
@@ -3522,10 +3522,6 @@
          $comm_data->{sockets}{$sl} = \%cdata;
      }

-    my $errors = 0;
-
-    my $report_errors = 1;
-
      my $pcmd = {
          pid => -1,
          in  => "",
@@ -3596,15 +3592,20 @@
      waitpid( $pcmd->{pid}, 0 );
      my $res = $?;

-    printf("result from parallel command was $res\n")
+    if ( $comm_data->{state} ne "shutdown" ) {
+        printf(
+"Unexpected exit from parallel command (state=$comm_data->{state})\n"
+        );
+    }
+    printf("result from parallel command was $res ($comm_data->{state})\n")
        if ( $conf{"verbose"} );

      if ( $res != 0 ) {
          my %status = rc_status($res);
          if ( job_is_running($jobid) ) {
-            if ($report_errors) {
-                printf("Failed to run parallel command (rc =  
$status{rc})\n");
-            }
+            printf(
+                "Bad exit code from parallel command  
(exit_code=$status{rc})\n"
+            );
          } else {
              printf("Job $jobid is no longer active\n");
              return 1;
@@ -4675,7 +4676,7 @@
      kill( "CONT", $pid );
      my $p = gdb_attach( $g, $pid );
      if ( !$p ) {
-        debug( $vp, "Failed to attach to $pid\n" );
+        debug( $vp, "Failed to attach to process\n" );
          return;
      }





More information about the padb-devel mailing list