From d59e9e148b54c5a68f0d3adaa07462d8057207d0 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 15 Mar 2016 17:06:40 +0000 Subject: MFC r296525: Just exit in the child if execve(2) fails. --- usr.bin/script/script.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'usr.bin/script/script.c') diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 1fb79f3..c990849 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); @@ -342,14 +341,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 -- cgit v1.1