This is the mail archive of the binutils-cvs@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]

[binutils-gdb] Set errcnt and warncnt to 0 in run_host_cmd_yesno


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d76b6207439e16b98aa04f38b730376257b31a62

commit d76b6207439e16b98aa04f38b730376257b31a62
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 26 11:55:57 2015 -0700

    Set errcnt and warncnt to 0 in run_host_cmd_yesno
    
    run_host_cmd_yesno should set errcnt and warncnt to 0.  Otherwise, they
    may leak to the next run.
    
    	* lib/ld-lib.exp (run_host_cmd_yesno): Set errcnt and warncnt
    	to 0.

Diff:
---
 ld/testsuite/ChangeLog      | 5 +++++
 ld/testsuite/lib/ld-lib.exp | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 5df4066..cd137f9 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* lib/ld-lib.exp (run_host_cmd_yesno): Set errcnt and warncnt
+	to 0.
+
 2015-07-25  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/18718
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 0cab4d3..6f71e97 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -125,8 +125,12 @@ proc run_host_cmd { prog command } {
 
 proc run_host_cmd_yesno { prog command } {
     global exec_output
+    global errcnt warncnt
 
     set exec_output [prune_warnings [run_host_cmd "$prog" "$command"]]
+    # Ignore error and warning.
+    set errcnt 0
+    set warncnt 0
     if [string match "" $exec_output] then {
 	return 1;
     }


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