# HG changeset patch # User Eric Blake # Date 1261248572 25200 # Node ID f7383de75775a1f9e178a3968ce5f267b13c1e17 # Parent 673d93dccba160accdbf2470222df9f89e41b22c 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 --- 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 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -46,7 +46,7 @@ # 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 --- 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)