Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-02-26 11:05:52 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2020-02-26 11:05:52 +0300
commit9aa751b08ab03d6396f86c3df77937a19687981b (patch)
treedf06300822ac071de0b913c6168f65cf8ffbe3eb
parent1555895b4af44ce47fe2365aec82e8e67c685f08 (diff)
shells: fix exitcode_trapN tests to avoid races
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xshell/ash_test/ash-misc/exitcode_trap2.tests3
-rwxr-xr-xshell/ash_test/ash-misc/exitcode_trap6.tests3
-rwxr-xr-xshell/hush_test/hush-misc/exitcode_trap2.tests3
-rwxr-xr-xshell/hush_test/hush-misc/exitcode_trap6.tests3
4 files changed, 4 insertions, 8 deletions
diff --git a/shell/ash_test/ash-misc/exitcode_trap2.tests b/shell/ash_test/ash-misc/exitcode_trap2.tests
index f259774bf..aff6d5187 100755
--- a/shell/ash_test/ash-misc/exitcode_trap2.tests
+++ b/shell/ash_test/ash-misc/exitcode_trap2.tests
@@ -3,7 +3,6 @@
$THIS_SH -c '
trap "false;exit" term
kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
'
echo 42:$?
diff --git a/shell/ash_test/ash-misc/exitcode_trap6.tests b/shell/ash_test/ash-misc/exitcode_trap6.tests
index 15fb99d2d..59a07fc91 100755
--- a/shell/ash_test/ash-misc/exitcode_trap6.tests
+++ b/shell/ash_test/ash-misc/exitcode_trap6.tests
@@ -5,7 +5,6 @@ $THIS_SH -c '
trap "echo INT" int
trap "kill -int $$;exit" term
kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
'
echo 42:$?
diff --git a/shell/hush_test/hush-misc/exitcode_trap2.tests b/shell/hush_test/hush-misc/exitcode_trap2.tests
index f259774bf..aff6d5187 100755
--- a/shell/hush_test/hush-misc/exitcode_trap2.tests
+++ b/shell/hush_test/hush-misc/exitcode_trap2.tests
@@ -3,7 +3,6 @@
$THIS_SH -c '
trap "false;exit" term
kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
'
echo 42:$?
diff --git a/shell/hush_test/hush-misc/exitcode_trap6.tests b/shell/hush_test/hush-misc/exitcode_trap6.tests
index 15fb99d2d..59a07fc91 100755
--- a/shell/hush_test/hush-misc/exitcode_trap6.tests
+++ b/shell/hush_test/hush-misc/exitcode_trap6.tests
@@ -5,7 +5,6 @@ $THIS_SH -c '
trap "echo INT" int
trap "kill -int $$;exit" term
kill $$ &
- (exit 42)
- wait
+ (sleep 1; exit 42)
'
echo 42:$?