[hurd,commited] hurd: Fix fdopendir checking for directory type

Message ID 20200528101850.1113542-1-samuel.thibault@ens-lyon.org
State Committed, archived
Headers
Series [hurd,commited] hurd: Fix fdopendir checking for directory type |

Commit Message

Samuel Thibault May 28, 2020, 10:18 a.m. UTC
  * sysdeps/mach/hurd/fdopendir.c (__fdopendir): Lookup "./" instead of
"/" that would designate the root of the filesystem.
---
 sysdeps/mach/hurd/fdopendir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/sysdeps/mach/hurd/fdopendir.c b/sysdeps/mach/hurd/fdopendir.c
index f15801f141..0583cdca0f 100644
--- a/sysdeps/mach/hurd/fdopendir.c
+++ b/sysdeps/mach/hurd/fdopendir.c
@@ -39,7 +39,7 @@  __fdopendir (int fd)
   /* Ensure that it's a directory.  */
   error_t err = HURD_FD_PORT_USE
     (d, ({
-	file_t dir = __file_name_lookup_under (port, "/",
+	file_t dir = __file_name_lookup_under (port, "./",
 					       O_DIRECTORY | O_NOTRANS, 0);;
 	if (dir != MACH_PORT_NULL)
 	  __mach_port_deallocate (__mach_task_self (), dir);