From: Samuel Thibault Date: Tue, 14 Apr 2026 22:39:16 +0000 (+0200) Subject: hurd: Fix looking up /dev/tty/ (BZ 34070) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=263efd544542c8fd991d8b483d69da5ca60b3181;p=thirdparty%2Fglibc.git hurd: Fix looking up /dev/tty/ (BZ 34070) We need to keep the heading / to properly get an ENOTDIR, and set file_name rather than change the retryname content. Also, *result is normally used for the startdir. --- diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c index 94ff0e3222..2a5ea16cba 100644 --- a/hurd/lookup-retry.c +++ b/hurd/lookup-retry.c @@ -323,9 +323,12 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port) err = opentty (result); goto out; case '/': - if (err = opentty (&startdir)) + if (*result != MACH_PORT_NULL) + __mach_port_deallocate (__mach_task_self (), *result); + if (err = opentty (result)) goto out; - memmove (retryname, &retryname[4], strlen(retryname + 4) + 1); + startdir = *result; + file_name = &retryname[3]; break; default: goto bad_magic;