# HG changeset patch # User Bruno Haible # Date 1307350912 -7200 # Node ID 344b70fb76a23bcc5d2d463b9397983cbfc1deea # Parent 722fb7942bc8564529fa75063bb3bf9744f087ac careadlinkat: Avoid mismatch between ssize_t and int. * lib/careadlinkat.h (careadlinkatcwd): Declare as a function always. * lib/careadlinkat.c (careadlinkatcwd): Define always. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-06-06 Bruno Haible + + careadlinkat: Avoid mismatch between ssize_t and int. + * lib/careadlinkat.h (careadlinkatcwd): Declare as a function always. + * lib/careadlinkat.c (careadlinkatcwd): Define always. + 2011-06-06 Jim Meyering gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c --- a/lib/careadlinkat.c +++ b/lib/careadlinkat.c @@ -39,7 +39,6 @@ #include "allocator.h" -#if ! HAVE_READLINKAT /* Get the symbolic link value of FILENAME and put it into BUFFER, with size BUFFER_SIZE. This function acts like readlink but has readlinkat's signature. */ @@ -53,7 +52,6 @@ abort (); return readlink (filename, buffer, buffer_size); } -#endif /* Assuming the current directory is FD, get the symbolic link value of FILENAME as a null-terminated string and put it into a buffer. diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h --- a/lib/careadlinkat.h +++ b/lib/careadlinkat.h @@ -56,8 +56,7 @@ when doing a plain readlink: Pass FD = AT_FDCWD and PREADLINKAT = careadlinkatcwd. */ #if HAVE_READLINKAT -/* AT_FDCWD is declared in , readlinkat in . */ -# define careadlinkatcwd readlinkat +/* AT_FDCWD is declared in . */ #else /* Define AT_FDCWD independently, so that the careadlinkat module does not depend on the fcntl-h module. The value does not matter, since @@ -66,8 +65,8 @@ # ifndef AT_FDCWD # define AT_FDCWD (-3041965) # endif +#endif ssize_t careadlinkatcwd (int fd, char const *filename, char *buffer, size_t buffer_size); -#endif #endif /* _GL_CAREADLINKAT_H */