2006-01-13 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Fri, 13 Jan 2006 20:13:21 +0000 (20:13 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 13 Jan 2006 20:13:21 +0000 (20:13 +0000)
* run-native-test.sh: Do kill -9 and reap explicitly at end, since
bash 3.1 whines when it's done in the trap 0 handler.

tests/ChangeLog
tests/run-native-test.sh

index 7ea768b..28207cf 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-13  Roland McGrath  <roland@redhat.com>
+
+       * run-native-test.sh: Do kill -9 and reap explicitly at end, since
+       bash 3.1 whines when it's done in the trap 0 handler.
+
 2006-01-11  Roland McGrath  <roland@redhat.com>
 
        * testfile26.bz2: New data file.
index d820214..2a5f388 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005 Red Hat, Inc.
+# Copyright (C) 2005, 2006 Red Hat, Inc.
 #
 # This program is Open Source software; you can redistribute it and/or
 # modify it under the terms of the Open Software License version 1.0 as
@@ -25,11 +25,21 @@ tempfiles native.c native
 echo 'main () { while (1) pause (); }' > native.c
 
 native=0
+kill_native()
+{
+  test $native -eq 0 || {
+    kill -9 $native 2> /dev/null || :
+    wait $native 2> /dev/null || :
+  }
+  native=0
+}
+
 native_cleanup()
 {
-  test $native -eq 0 || kill -9 $native || :
-  rm -f $remove_files
+  kill_native
+  test_cleanup
 }
+
 trap native_cleanup 0 1 2 15
 
 for cc in "$HOSTCC" "$HOST_CC" cc gcc "$CC"; do
@@ -56,3 +66,10 @@ native_test()
 
 native_test ./allregs
 native_test ./funcretval
+
+# We do this explicitly rather than letting the trap 0 cover it,
+# because as of version 3.1 bash prints the "Killed" report for
+# $native when we do the kill inside the exit handler.
+native_cleanup
+
+exit 0