diff mbox series

Linux: Avoid closing -1 on failure in __closefrom_fallback

Message ID 87v92rr0b9.fsf@oldenburg.str.redhat.com
State Committed
Commit 5ad9d62c3b7438c70452d6a9b2c7810f9f28bf32
Headers show
Series Linux: Avoid closing -1 on failure in __closefrom_fallback | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer Sept. 23, 2021, 11:36 a.m. UTC
---
 sysdeps/unix/sysv/linux/closefrom_fallback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

H.J. Lu Sept. 23, 2021, 4:29 p.m. UTC | #1
On Thu, Sep 23, 2021 at 4:36 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> ---
>  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 9cca55653a..f215fd2c09 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];
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/closefrom_fallback.c b/sysdeps/unix/sysv/linux/closefrom_fallback.c
index 9cca55653a..f215fd2c09 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];