Skip to content

Commit

Permalink
fuzz: accept ESRCH as a "valid" errno
Browse files Browse the repository at this point in the history
Recently discovered by CI:

```
  df_crash...
Error while reading process' stat file: No such processExit status: 1
```
  • Loading branch information
mrc0mmand committed May 3, 2022
1 parent e330624 commit 61fcce5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static int df_check_if_exited(const int pid) {

f = fopen(proc_pid, "r");
if (!f) {
if (errno == ENOENT || errno == ENOTDIR)
if (errno == ENOENT || errno == ENOTDIR || errno == ESRCH)
return 0;

return -1;
Expand Down Expand Up @@ -469,7 +469,7 @@ int df_fuzz_test_method(

r = df_check_if_exited(pid);
if (r < 0)
return df_fail_ret(-1, "Error while reading process' stat file: %m");
return df_fail_ret(-1, "Error while reading process' stat file: %m\n");
else if (r == 0) {
ret = -1;
df_fail("%s %sFAIL%s %s - process %d exited\n",
Expand Down

0 comments on commit 61fcce5

Please sign in to comment.