From 5ad9d62c3b7438c70452d6a9b2c7810f9f28bf32 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 24 Sep 2021 19:51:41 +0200
Subject: [PATCH] Linux: Avoid closing -1 on failure in __closefrom_fallback

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
---
 sysdeps/unix/sysv/linux/closefrom_fallback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/closefrom_fallback.c b/sysdeps/unix/sysv/linux/closefrom_fallback.c
index 9cca556..f215fd2 100644
--- a/sysdeps/unix/sysv/linux/closefrom_fallback.c
+++ b/sysdeps/unix/sysv/linux/closefrom_fallback.c
@@ -48,7 +48,7 @@ __closefrom_fallback (int from, _Bool dirfd_fallback)
       dirfd = __open_nocancel (FD_TO_FILENAME_PREFIX, O_RDONLY | O_DIRECTORY,
                                0);
       if (dirfd == -1)
-        goto err;
+        return false;
     }
 
   char buffer[1024];
-- 
1.8.3.1

