about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/fdopendir.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/fdopendir.c')
-rw-r--r--sysdeps/mach/hurd/fdopendir.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sysdeps/mach/hurd/fdopendir.c b/sysdeps/mach/hurd/fdopendir.c
index 2a152b07a1..33ea2f0cf2 100644
--- a/sysdeps/mach/hurd/fdopendir.c
+++ b/sysdeps/mach/hurd/fdopendir.c
@@ -31,10 +31,7 @@ __fdopendir (int fd)
   struct hurd_fd *d = _hurd_fd_get (fd);
 
   if (d == NULL)
-    {
-      errno = EBADF;
-      return NULL;
-    }
+    return __hurd_fail (EBADF), NULL;
 
   /* Ensure that it's a directory.  */
   error_t err = HURD_FD_PORT_USE
@@ -47,10 +44,7 @@ __fdopendir (int fd)
       }));
 
   if (err)
-    {
-      errno = err;
-      return NULL;
-    }
+    return __hurd_dfail (fd, err), NULL;
 
   return _hurd_fd_opendir (d);
 }