Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix O_DIRECTORY lookup on trivial translators
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
leading slash when `file_name' is "/".
  • Loading branch information
Flavio Cruz authored and Samuel Thibault committed Jan 12, 2016
1 parent fb53a27 commit e42ce0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2016-01-13 Flavio Cruz <flaviocruz@gmail.com>

* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
leading slash when `file_name' is "/".

2016-01-12 Joseph Myers <joseph@codesourcery.com> 2016-01-12 Joseph Myers <joseph@codesourcery.com>


* bits/mman-linux.h [!MCL_CURRENT] (MCL_ONFAULT): New macro. * bits/mman-linux.h [!MCL_CURRENT] (MCL_ONFAULT): New macro.
Expand Down
11 changes: 9 additions & 2 deletions hurd/lookup-retry.c
Expand Up @@ -62,8 +62,15 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)


error_t lookup_op (file_t startdir) error_t lookup_op (file_t startdir)
{ {
while (file_name[0] == '/') if (file_name[0] == '/' && file_name[1] != '\0')
file_name++; {
while (file_name[1] == '/')
/* Remove double leading slash. */
file_name++;
if (file_name[1] != '\0')
/* Remove leading slash when we have more than the slash. */
file_name++;
}


return lookup_error ((*lookup) (startdir, file_name, flags, mode, return lookup_error ((*lookup) (startdir, file_name, flags, mode,
&doretry, retryname, result)); &doretry, retryname, result));
Expand Down

0 comments on commit e42ce0f

Please sign in to comment.