Make sure /proc/$$/fd exists.
This avoids the error message generated by enumerator_create_directory().
This commit is contained in:
1 parent
5051bd23eb
commit
4a4cf41b9a
1 file changed
+1
-1
@@ -205,7 +205,7 @@ void closefrom(int lowfd)
|
||||
|
||||
/* try to close only open file descriptors on Linux... */
|
||||
len = snprintf(fd_dir, sizeof(fd_dir), "/proc/%u/fd", getpid());
|
||||
if (len > 0 && len < sizeof(fd_dir))
|
||||
if (len > 0 && len < sizeof(fd_dir) && access(fd_dir, F_OK) == 0)
|
||||
{
|
||||
enumerator_t *enumerator = enumerator_create_directory(fd_dir);
|
||||
if (enumerator)
|
||||
|
||||
Reference in new issue
Block a user