ww: driver/coordinator robustness — dirent errors, EINTR, block comments
Three same-cluster robustness holes. enumeratedir treated a failed getdents64 (r<0) as EOF: a mid-walk error silently truncated the package source list, and a first-read error was misdiagnosed as "directory contains no WW package sources" -- it now routes the caller's "cannot read directory" arm. run_test_bin's waitpid had no EINTR retry and its return was unchecked, so an interrupted wait left status==0 and reported a false test PASS (the do_run twin already retried). The coordinator's pkgskipspace now also skips /* */ before the package clause like the driver's sep_skip_space -- a source opening with a block comment built under ww but failed coordinator discovery.
This commit is contained in:
@@ -72,7 +72,12 @@ run_test_bin(const char *bin, const char *pattern)
|
||||
_exit(127);
|
||||
}
|
||||
int status = 0;
|
||||
waitpid(pid, &status, 0);
|
||||
/* the do_run twin's EINTR discipline: an interrupted wait left
|
||||
* status==0, so WIFEXITED(0)/WEXITSTATUS(0) reported a false
|
||||
* test PASS. */
|
||||
pid_t got;
|
||||
do { got = waitpid(pid, &status, 0); } while (got < 0 && errno == EINTR);
|
||||
if (got < 0) { perror("ww: waitpid"); return -1; }
|
||||
if (WIFEXITED(status)) return WEXITSTATUS(status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user