From: Eric Blake Date: Sat, 19 Dec 2009 18:49:32 +0000 (-0700) Subject: dirfd: fix prototype X-Git-Tag: v0.1~5025 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=156a4895aad6b6f0ae8d883d1da354bd083518a6;p=gnulib.git dirfd: fix prototype Fix prototype to match POSIX. * lib/dirent.in.h (dirfd): Argument is not const, per POSIX. * lib/dirfd.c (dirfd): Likewise. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 4e3a924c1..f392c10de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-12-19 Eric Blake + dirfd: fix prototype + * lib/dirent.in.h (dirfd): Argument is not const, per POSIX. + * lib/dirfd.c (dirfd): Likewise. + canonicalize: reduce memory usage * lib/canonicalize.c (canonicalize_filename_mode): Trim the allocation to size. diff --git a/lib/dirent.in.h b/lib/dirent.in.h index 8694b8596..f0fd26ea8 100644 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -46,7 +46,7 @@ extern int closedir (DIR *) _GL_ARG_NONNULL ((1)); # if !@HAVE_DECL_DIRFD@ && !defined dirfd /* Return the file descriptor associated with the given directory stream, or -1 if none exists. */ -extern int dirfd (DIR const *dir) _GL_ARG_NONNULL ((1)); +extern int dirfd (DIR *dir) _GL_ARG_NONNULL ((1)); # endif #elif defined GNULIB_POSIXCHECK # undef dirfd diff --git a/lib/dirfd.c b/lib/dirfd.c index 81993c502..ea8ec4eb8 100644 --- a/lib/dirfd.c +++ b/lib/dirfd.c @@ -23,7 +23,7 @@ #include int -dirfd (DIR const *dir_p) +dirfd (DIR *dir_p) { int fd = DIR_TO_FD (dir_p); if (fd == -1)