summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/man
diff options
context:
space:
mode:
authorMike Pritchard <mpp@FreeBSD.org>1997-02-09 07:58:34 +0000
committerMike Pritchard <mpp@FreeBSD.org>1997-02-09 07:58:34 +0000
commit3d9565db10b3b4b698ce66c2bc5ba0d0f730ec3e (patch)
tree52605c5afc37b0aebbe9ccf38b979dd8a452f81a /gnu/usr.bin/man
parentd5545015ef32a66833956df1b67eca170a4d8dc8 (diff)
Notes
Diffstat (limited to 'gnu/usr.bin/man')
-rw-r--r--gnu/usr.bin/man/lib/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnu/usr.bin/man/lib/util.c b/gnu/usr.bin/man/lib/util.c
index 6db023b7368b..995d318bc530 100644
--- a/gnu/usr.bin/man/lib/util.c
+++ b/gnu/usr.bin/man/lib/util.c
@@ -139,6 +139,16 @@ do_system_command (command)
else
status = system (command);
+ /* check return value from system() function first */
+ if (status == -1) {
+ fprintf(stderr,
+ "wait() for exit status of shell failed in function system()\n");
+ return 0;
+ } else if (status == 127 || status == (127 << 8)) {
+ fprintf(stderr, "execution of the shell failed in function system()\n");
+ return 0;
+ }
+
if (WIFSIGNALED(status))
return -1;
else if (WEXITSTATUS(status)) {