diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2021-09-02 11:26:55 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2021-09-02 11:26:55 +0000 |
commit | 3be7192d5b3621d0b650bc1d5c9d3d5b4422d0ae (patch) | |
tree | c2c90725195cacfdcda565af728b562f225f2bcd /usr.bin/timeout/timeout.c | |
parent | d1d9f3bd0421d0b1d3c10333d13ecc6a17ce6805 (diff) |
timeout(1): execvp(2) does not return except on error
there is no need to check if the return value is -1. just
unconditionally call err(3).
ok deraadt@ schwarze@
Diffstat (limited to 'usr.bin/timeout/timeout.c')
-rw-r--r-- | usr.bin/timeout/timeout.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/timeout/timeout.c b/usr.bin/timeout/timeout.c index 616ff3ae88e..cbceb70a3df 100644 --- a/usr.bin/timeout/timeout.c +++ b/usr.bin/timeout/timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timeout.c,v 1.16 2021/09/02 09:35:17 deraadt Exp $ */ +/* $OpenBSD: timeout.c,v 1.17 2021/09/02 11:26:54 semarie Exp $ */ /* * Copyright (c) 2021 Job Snijders <job@openbsd.org> @@ -164,7 +164,7 @@ main(int argc, char **argv) int ch; unsigned long i; int foreground = 0, preserve = 0; - int error, pstat, status; + int pstat, status; int killsig = SIGTERM; pid_t pgid = 0, pid, cpid = 0; double first_kill; @@ -250,9 +250,8 @@ main(int argc, char **argv) signal(SIGTTIN, SIG_DFL); signal(SIGTTOU, SIG_DFL); - error = execvp(argv[0], argv); - if (error == -1) - err(1, "execvp"); + execvp(argv[0], argv); + err(1, "execvp"); } /* parent continues here */ |