summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-02-23 22:50:57 +0000
committerjilles <jilles@FreeBSD.org>2013-02-23 22:50:57 +0000
commit6d26f3b024394ea5908af3fa212793fa333a2fdf (patch)
tree96a8314009f5f8c2883aef886d308ca958d3405c /tools
parenta615230e591865d556975a47a4dc7d5cefbf4ebd (diff)
downloadFreeBSD-src-6d26f3b024394ea5908af3fa212793fa333a2fdf.zip
FreeBSD-src-6d26f3b024394ea5908af3fa212793fa333a2fdf.tar.gz
sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/builtins/wait4.012
-rw-r--r--tools/regression/bin/sh/builtins/wait5.012
2 files changed, 24 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/wait4.0 b/tools/regression/bin/sh/builtins/wait4.0
new file mode 100644
index 0000000..7935131
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/wait4.0
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX`
+trap 'rm -rf $T' 0
+cd $T || exit 3
+mkfifo fifo1
+trapped=
+trap trapped=1 QUIT
+{ kill -QUIT $$; sleep 1; exit 4; } >fifo1 &
+wait $! <fifo1
+r=$?
+[ "$r" -gt 128 ] && [ -n "$trapped" ]
diff --git a/tools/regression/bin/sh/builtins/wait5.0 b/tools/regression/bin/sh/builtins/wait5.0
new file mode 100644
index 0000000..6874bf6
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/wait5.0
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX`
+trap 'rm -rf $T' 0
+cd $T || exit 3
+mkfifo fifo1
+trapped=
+trap trapped=1 QUIT
+{ kill -QUIT $$; sleep 1; exit 4; } >fifo1 &
+wait <fifo1
+r=$?
+[ "$r" -gt 128 ] && [ -n "$trapped" ]
OpenPOWER on IntegriCloud