-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to POSIX, dirfd does not take a const argument. I'm applying this:
- -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkstIM4ACgkQ84KuGfSFAYDlSwCgnG/84ORxWvyWjLKT1rWG+nEY YuYAoNLdomupncwJiEbU9WGIGzK3Vjmc =vxLH -----END PGP SIGNATURE-----
>From c3815b3682210097f172d77ac132dd439568e315 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Sat, 19 Dec 2009 11:49:32 -0700 Subject: [PATCH] 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 <e...@byu.net> --- ChangeLog | 4 ++++ lib/dirent.in.h | 2 +- lib/dirfd.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3f3cb7..1aa2977 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-12-19 Eric Blake <e...@byu.net> + 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 ef11c47..f79ce0b 100644 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -45,7 +45,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 81993c5..ea8ec4e 100644 --- a/lib/dirfd.c +++ b/lib/dirfd.c @@ -23,7 +23,7 @@ #include <errno.h> int -dirfd (DIR const *dir_p) +dirfd (DIR *dir_p) { int fd = DIR_TO_FD (dir_p); if (fd == -1) -- 1.6.5.rc1