diff --git a/lib/iolog/regress/iolog_mkpath/check_iolog_mkpath.c b/lib/iolog/regress/iolog_mkpath/check_iolog_mkpath.c index f0ece1a09..7b9ff9e33 100644 --- a/lib/iolog/regress/iolog_mkpath/check_iolog_mkpath.c +++ b/lib/iolog/regress/iolog_mkpath/check_iolog_mkpath.c @@ -97,8 +97,17 @@ main(int argc, char *argv[]) } /* Clean up (avoid running via shell) */ - execvp("rm", (char **)rmargs); - wait(&status); + switch (fork()) { + case -1: + sudo_warn("fork"); + _exit(1); + case 0: + execvp("rm", (char **)rmargs); + _exit(1); + default: + wait(&status); + break; + } return errors; }