This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] [Hurd] Fix __file_name_lookup_at() return value
- From: Emilio Pozuelo Monfort <pochu27 at gmail dot com>
- To: libc-alpha at sources dot redhat dot com, Roland McGrath <roland at gnu dot org>
- Date: Sat, 24 Apr 2010 20:29:20 +0200
- Subject: [PATCH] [Hurd] Fix __file_name_lookup_at() return value
Hi,
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
that.
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).
Best,
Emilio
2010-04-24 Emilio Pozuelo Monfort <pochu27@gmail.com>
* hurd/lookup-at.c (__file_name_lookup_at): Fix return
value.
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);