Jim Meyering <jim <at> meyering.net> writes: > > 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.
How about this followup. >From 2c479d06f3fa8d97e22ce8eb46f14990fde2ce12 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Thu, 8 Oct 2009 10:09:05 -0600 Subject: [PATCH] areadlink: make SIZE_T use consistent * modules/areadlink (Depends-on): Add stdint. * modules/areadlink-with-size (Depends-on): Likewise. * lib/areadlink.c (includes): Update list of headers. (SIZE_MAX): Rely on headers. * lib/areadlink-with-size.c (includes, SIZE_MAX): Likewise. * lib/areadlinkat-with-size.c (includes): Likewise. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 10 ++++++++++ lib/areadlink-with-size.c | 8 ++------ lib/areadlink.c | 10 ++++------ lib/areadlinkat-with-size.c | 3 +-- lib/areadlinkat.c | 3 +-- modules/areadlink | 3 ++- modules/areadlink-with-size | 1 + 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41ec5fd..1300c2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2009-10-08 Eric Blake <e...@byu.net> + areadlink: make SIZE_T use consistent + * modules/areadlink (Depends-on): Add stdint. + * modules/areadlink-with-size (Depends-on): Likewise. + * lib/areadlink.c (includes): Update list of headers. + (SIZE_MAX): Rely on headers. + * lib/areadlink-with-size.c (includes, SIZE_MAX): Likewise. + * lib/areadlinkat-with-size.c (includes): Likewise. + +2009-10-08 Eric Blake <e...@byu.net> + utimens: introduce fdutimens * lib/utimens.h (fdutimens): New prototype. * lib/utimens.c (gl_futimens): Move guts... diff --git a/lib/areadlink-with-size.c b/lib/areadlink-with-size.c index d0bcb70..625ddb7 100644 --- a/lib/areadlink-with-size.c +++ b/lib/areadlink-with-size.c @@ -1,7 +1,7 @@ /* readlink wrapper to return the link name in malloc'd storage. Unlike xreadlink and xreadlink_with_size, don't ever call exit. - Copyright (C) 2001, 2003-2007 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,16 +22,12 @@ #include "areadlink.h" -#include <stdio.h> #include <errno.h> #include <limits.h> -#include <sys/types.h> +#include <stdint.h> #include <stdlib.h> #include <unistd.h> -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif diff --git a/lib/areadlink.c b/lib/areadlink.c index 4e770eb..8fd2288 100644 --- a/lib/areadlink.c +++ b/lib/areadlink.c @@ -1,7 +1,7 @@ /* areadlink.c -- readlink wrapper to return the link name in malloc'd storage Unlike xreadlink and xreadlink_with_size, don't ever call exit. - Copyright (C) 2001, 2003-2007 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2007, 2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,16 +24,14 @@ /* Specification. */ #include "areadlink.h" -#include <string.h> #include <errno.h> #include <limits.h> -#include <sys/types.h> +#include <stdint.h> #include <stdlib.h> +#include <string.h> +#include <sys/types.h> #include <unistd.h> -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif diff --git a/lib/areadlinkat-with-size.c b/lib/areadlinkat-with-size.c index d1abb5b..4ad76b7 100644 --- a/lib/areadlinkat-with-size.c +++ b/lib/areadlinkat-with-size.c @@ -23,10 +23,9 @@ #include "areadlink.h" -#include <stdio.h> #include <errno.h> #include <limits.h> -#include <sys/types.h> +#include <stdint.h> #include <stdlib.h> #include <unistd.h> diff --git a/lib/areadlinkat.c b/lib/areadlinkat.c index 07714d0..53f3e53 100644 --- a/lib/areadlinkat.c +++ b/lib/areadlinkat.c @@ -25,12 +25,11 @@ /* Specification. */ #include "areadlink.h" -#include <string.h> #include <errno.h> #include <limits.h> -#include <sys/types.h> #include <stdint.h> #include <stdlib.h> +#include <string.h> #include <unistd.h> #ifndef SSIZE_MAX diff --git a/modules/areadlink b/modules/areadlink index 2acc4a9..dc7cfe4 100644 --- a/modules/areadlink +++ b/modules/areadlink @@ -6,10 +6,11 @@ lib/areadlink.h lib/areadlink.c Depends-on: +malloc-posix readlink ssize_t +stdint unistd -malloc-posix configure.ac: diff --git a/modules/areadlink-with-size b/modules/areadlink-with-size index df6db33..212f8ab 100644 --- a/modules/areadlink-with-size +++ b/modules/areadlink-with-size @@ -8,6 +8,7 @@ lib/areadlink-with-size.c Depends-on: readlink ssize_t +stdint unistd configure.ac: -- 1.6.4.2