+2013-04-27 Mark Wielaard <mjw@redhat.com>
+
+ * test-subr.sh (exit_cleanup): New function.
+ (trap): Use exit_cleanup as argument.
+ * run-native-test.sh (native_exit): New function.
+ (trap): For EXIT (0) use native_exit as argument.
+
2013-04-27 Mark Wielaard <mjw@redhat.com>
* update1.c (main): Use unique tempfile name and unlink file.
#! /bin/sh
-# Copyright (C) 2005, 2006 Red Hat, Inc.
+# Copyright (C) 2005, 2006, 2013 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
test_cleanup
}
-trap native_cleanup 0 1 2 15
+native_exit()
+{
+ native_cleanup
+ exit_cleanup
+}
+
+trap native_cleanup 1 2 15
+trap native_exit 0
for cc in "$HOSTCC" "$HOST_CC" cc gcc "$CC"; do
test "x$cc" != x || continue
#! /bin/sh
-# Copyright (C) 2005-2012 Red Hat, Inc.
+# Copyright (C) 2005-2013 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
#export LC_ALL
remove_files=
-trap 'rm -f $remove_files; popd > /dev/null; rmdir $test_dir' 0
+
+# Tests that trap EXIT (0) themselves should call this explicitly.
+exit_cleanup()
+{
+ rm -f $remove_files; popd > /dev/null; rmdir $test_dir
+}
+trap exit_cleanup 0
tempfiles()
{