This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix default_binutils_run to check exit status


default_binutils_run doesn't check exit status. If a program
segfaults and doesn't generate any output, default_binutils_run
think it is successful. This patch checks exit status.


H.J.
----
2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>

	* lib/utils-lib.exp (default_binutils_run): Check exit status.

--- binutils/testsuite/lib/utils-lib.exp.status	2005-05-08 07:17:41.000000000 -0700
+++ binutils/testsuite/lib/utils-lib.exp	2006-04-06 12:59:45.000000000 -0700
@@ -73,6 +73,12 @@ proc default_binutils_run { prog progarg
     if {![string match "" $exec_output]} then {
 	send_log "$exec_output\n"
 	verbose "$exec_output"
+    } else {
+	if { [lindex $state 0] != 0 } {
+	    set exec_output "$prog exited with status [lindex $state 0]"
+	    send_log "$exec_output\n"
+	    verbose "$exec_output"
+	}
     }
     return $exec_output
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]