summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-03-08 18:05:20 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-03-08 18:05:20 +0000
commit49a860c3b1235560e6919b9b1c5b06dd585f60ce (patch)
treecbd502e6fee68ec5481dc7746ddb608245bf203a /usr.bin
parentf234bc3e5459e357aae04d83354e1218c51198fa (diff)
downloadFreeBSD-src-49a860c3b1235560e6919b9b1c5b06dd585f60ce.zip
FreeBSD-src-49a860c3b1235560e6919b9b1c5b06dd585f60ce.tar.gz
Just exit in the child if execve(2) fails.
No functional change. This is mostly addressing a false-positive from the clang static analyzer due to it thinking that done() was being called with freed memory, however the kill(0, SIGTERM) made the done() never reached. It doesn't make sense to the show the footer from the child anyhow, nor does it make sense to kill the process group here since the execve(2) failed in the child. This code was leftover from many years of refactoring. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/script/script.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index 49446ef..4c5e402 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -80,7 +80,6 @@ static struct termios tt;
static void done(int) __dead2;
static void doshell(char **);
-static void fail(void);
static void finish(void);
static void record(FILE *, char *, size_t, int);
static void consume(FILE *, off_t, char *, int);
@@ -347,14 +346,7 @@ doshell(char **av)
execl(shell, shell, "-i", (char *)NULL);
warn("%s", shell);
}
- fail();
-}
-
-static void
-fail(void)
-{
- (void)kill(0, SIGTERM);
- done(1);
+ exit(1);
}
static void
OpenPOWER on IntegriCloud