diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-03-10 17:44:28 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-03-10 17:47:13 +0100 |
| commit | 764449a269c8fbf007997c2cfc13612fad69c50c (patch) | |
| tree | 296eae505de7f85012c9da5165e7e56bb8420c09 /executor | |
| parent | 4b4dc9d1f30c996dc5eefbecbf91399939adbee5 (diff) | |
executor: ignore NOFILE errors during cleanup
This is a common source of false positives.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/executor.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index 6c63b4667..b42dba6ed 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -878,8 +878,15 @@ void remove_dir(const char* dir) int iter = 0; retry: DIR* dp = opendir(dir); - if (dp == NULL) + if (dp == NULL) { + if (errno == EMFILE) { + // This happens when the test process casts prlimit(NOFILE) on us. + // Ideally we somehow prevent test processes from messing with parent processes. + // But full sandboxing is expensive, so let's ignore this error for now. + exitf("opendir(%s) failed due to NOFILE, exiting"); + } fail("opendir(%s) failed", dir); + } while (dirent* ep = readdir(dp)) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; |
