aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-03-10 17:44:28 +0100
committerDmitry Vyukov <dvyukov@google.com>2016-03-10 17:47:13 +0100
commit764449a269c8fbf007997c2cfc13612fad69c50c (patch)
tree296eae505de7f85012c9da5165e7e56bb8420c09 /executor/executor.cc
parent4b4dc9d1f30c996dc5eefbecbf91399939adbee5 (diff)
executor: ignore NOFILE errors during cleanup
This is a common source of false positives.
Diffstat (limited to 'executor/executor.cc')
-rw-r--r--executor/executor.cc9
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;