summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/dialog
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-02-13 19:49:42 +0000
committerache <ache@FreeBSD.org>1995-02-13 19:49:42 +0000
commit1a5b05c3c75abfbbd38a2349a215e7269f320915 (patch)
treefda39121f12355ffa7d6d24c6765ef7ca13619a0 /gnu/usr.bin/dialog
parent6f54c02095ee56289d5a747e9e3073ef810f9dc4 (diff)
downloadFreeBSD-src-1a5b05c3c75abfbbd38a2349a215e7269f320915.zip
FreeBSD-src-1a5b05c3c75abfbbd38a2349a215e7269f320915.tar.gz
Pass prgbox exit code to main exit code
Diffstat (limited to 'gnu/usr.bin/dialog')
-rwxr-xr-xgnu/usr.bin/dialog/TESTS/prgbox4
-rw-r--r--gnu/usr.bin/dialog/dialog.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/gnu/usr.bin/dialog/TESTS/prgbox b/gnu/usr.bin/dialog/TESTS/prgbox
index 708df5d..5a631f5 100755
--- a/gnu/usr.bin/dialog/TESTS/prgbox
+++ b/gnu/usr.bin/dialog/TESTS/prgbox
@@ -7,6 +7,6 @@ $DIALOG --title "PROGRAM BOX: 'cal'" --clear \
case $? in
0)
echo "OK";;
- 255)
- echo "ESC pressed.";;
+ *)
+ echo "Exit code:" $?;;
esac
diff --git a/gnu/usr.bin/dialog/dialog.c b/gnu/usr.bin/dialog/dialog.c
index bc4edad..16c426d 100644
--- a/gnu/usr.bin/dialog/dialog.c
+++ b/gnu/usr.bin/dialog/dialog.c
@@ -80,6 +80,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/wait.h>
#include <dialog.h>
void Usage(unsigned char *name);
@@ -189,7 +190,7 @@ int main(int argc, unsigned char *argv[])
if (clear_screen) /* clear screen before exit */
dialog_clear();
end_dialog();
- return retval;
+ return WEXITSTATUS(retval);
}
else if (!strcmp(argv[offset+1], "--infobox")) {
if (argc-offset != 5) {
OpenPOWER on IntegriCloud