Message ID | 20220323204756.3654868-1-adhemerval.zanella@linaro.org |
---|---|
State | New |
Headers | show |
Series | linux: Fix __closefrom_fallback iterates until max int (BZ#28993) | expand |
diff --git a/sysdeps/unix/sysv/linux/closefrom_fallback.c b/sysdeps/unix/sysv/linux/closefrom_fallback.c index 60101aa3ba..505daa5a53 100644 --- a/sysdeps/unix/sysv/linux/closefrom_fallback.c +++ b/sysdeps/unix/sysv/linux/closefrom_fallback.c @@ -37,7 +37,7 @@ __closefrom_fallback (int from, _Bool dirfd_fallback) if (dirfd == -1) { /* The closefrom should work even when process can't open new files. */ - if (errno == ENOENT || !dirfd_fallback) + if (errno != EMFILE || !dirfd_fallback) goto err; for (int i = from; i < INT_MAX; i++)