bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: areadlinkat


From: Jim Meyering
Subject: Re: areadlinkat
Date: Thu, 08 Oct 2009 16:44:08 +0200

Eric Blake wrote:
> According to Eric Blake on 10/7/2009 11:00 AM:
>> Eric Blake <ebb9 <at> byu.net> writes:
>>
>>> The patch copies from areadlink.c, as well as link_follow earlier in
>>> linkat.c, to create two new fd-relative helpers.  For now, I didn't see
>>> any reason to expose them, but areadlinkat may someday be worth making
>>> into a full-blown module.
>>
>> Further looking shows that:
>>
>> findutils' listfile.c currently uses a home-rolled get_link_name_at which
>> blindly changes the working directory, and calls xalloc_die on allocation
>> failure.  Perfect candidate for xreadlinkat, to be more efficient on 
>> platforms
>> with native readlinkat.  And xreadlinkat implies areadlinkat.
>>
>> coreutils' copy.c currently uses areadlink_with_size for copying/moving
>> symlinks across partitions, but since we want to rewrite this to use fts, we
>> will need an *at variant.
>>
>> So, I've written three new modules: areadlinkat, areadlinkat-with-size, and
>> xreadlinkat; mirroring the three existing modules areadlink, areadlink-with-
>> size, xreadlink.
>>
>> Eric Blake (4):
>>       areadlink, areadlink-with-size: add tests
>>       areadlinkat: new module
>>       xreadlinkat: new module
>>       areadlinkat-with-size: new module
>
> Based on Jim's preliminary review, I've now pushed this series.

I tried it with coreutils on fedora rawhide and hit a compile
failure (SIZE_MAX, again).  Also fixed the first-line summary
to mention the right file and function names.

I fixed it the same way as for linkat.
If you prefer simply adding a SIZE_MAX definition,
you're welcome to do that instead.

I've pushed this:

>From 01b49fe4d1da5914f69ea22dac6e34fa905c83a4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 8 Oct 2009 16:40:49 +0200
Subject: [PATCH] areadlinkat: avoid compilation failure

* lib/areadlinkat.c: Include <stdint.h> for use of SIZE_MAX.
Fix typo in comment.
---
 ChangeLog         |    6 ++++++
 lib/areadlinkat.c |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dedcfc8..3af4f51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-08  Jim Meyering  <address@hidden>
+
+       areadlinkat: avoid compilation failure
+       * lib/areadlinkat.c: Include <stdint.h> for use of SIZE_MAX.
+       Fix typo in comment.
+
 2009-10-07  Eric Blake  <address@hidden>

        areadlinkat-with-size: new module
diff --git a/lib/areadlinkat.c b/lib/areadlinkat.c
index 5e8bf9d..07714d0 100644
--- a/lib/areadlinkat.c
+++ b/lib/areadlinkat.c
@@ -1,4 +1,4 @@
-/* areadlink.c -- readlink wrapper to return the link name in malloc'd storage
+/* areadlinkat.c -- readlinkat wrapper to return malloc'd link name
    Unlike xreadlinkat, only call exit on failure to change directory.

    Copyright (C) 2001, 2003-2007, 2009 Free Software Foundation, Inc.
@@ -29,6 +29,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/types.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>

--
1.6.5.rc3.193.gdf7a




reply via email to

[Prev in Thread] Current Thread [Next in Thread]