This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [Hurd] Fix __file_name_lookup_at() return value


This is my first patch to glibc, and I don't have any copyright assignment to
the FSF yet, but since the patch is a one liner I hope there is no problem with

Since I plan to submit more patches, I guess I should assign copyright to the
FSF. Can somebody please point me on how to do it?

The patch fixes a return value in __file_name_lookup_at(), which is supposed to
return file_t and was returning -1 instead of MACH_PORT_NULL. It can be easily
tested with `ln' from coreutils >= 8.4 (which uses linkat()), a simple `ln a b'
will fail with `Computer bought the farm'. This patch makes it fail with
`Invalid argument' (linkat() and __file_name_lookup_at() need more fixing, I'll
submit another patch for that later on).


2010-04-24  Emilio Pozuelo Monfort  <>

	* hurd/lookup-at.c (__file_name_lookup_at): Fix return

diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c
index a2d50cb..c2b5ecb 100644
--- a/hurd/lookup-at.c
+++ b/hurd/lookup-at.c
@@ -33,7 +33,7 @@ __file_name_lookup_at (int fd, int at_flags,
   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
   at_flags &= ~AT_SYMLINK_NOFOLLOW;
   if (at_flags != 0)
-    return __hurd_fail (EINVAL);
+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);

   if (fd == AT_FDCWD || file_name[0] == '/')
     return __file_name_lookup (file_name, flags, mode);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]