Protect against fdopendir failure.

This commit is contained in:
Érico Nogueira 2022-01-21 15:59:41 -03:00
parent aa22e06b23
commit 9a1eecd457
1 changed files with 4 additions and 0 deletions

View File

@ -144,6 +144,10 @@ static void *process_queue_item(void *arg)
}
}
DIR *d = fdopendir(dfd);
if (!d) {
fprintf(stderr, "couldn't create directory stream: %m\n");
exit(1);
}
struct task *p = NULL;
unsigned n = 0;