dirfd: fix prototype
authorEric Blake <ebb9@byu.net>
Sat, 19 Dec 2009 18:49:32 +0000 (11:49 -0700)
committerEric Blake <ebb9@byu.net>
Sat, 19 Dec 2009 18:53:55 +0000 (11:53 -0700)
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 <ebb9@byu.net>
ChangeLog
lib/dirent.in.h
lib/dirfd.c

index 4e3a924..f392c10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-12-19  Eric Blake  <ebb9@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.
index 8694b85..f0fd26e 100644 (file)
@@ -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
index 81993c5..ea8ec4e 100644 (file)
@@ -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)