Hi Sebastien,
Sebastien Marie wrote on Thu, Sep 02, 2021 at 09:09:43AM +0200:
> If execvp(2) returns, it is always an error: there is no need to check
> if the return value is -1. Just unconditionally call err(3).
>
> Comments or OK ?
OK schwarze@
Ingo
> timeout: execvp(2) should not return except on error
"should not" is confusing, "does not" would be clearer.
> --- usr.bin/timeout/timeout.c
> +++ usr.bin/timeout/timeout.c
> @@ -165,7 +165,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;
> @@ -251,9 +251,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");
> }
>
> if (pledge("stdio", NULL) == -1)