opendir: avoid compile warning
authorEric Blake <eblake@redhat.com>
Wed, 14 Sep 2011 14:19:35 +0000 (08:19 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 14 Sep 2011 14:19:35 +0000 (08:19 -0600)
If HAVE_OPENDIR but also REPLACE_FCHDIR, then errno was used without
including the proper header.

* lib/opendir.c (includes): Always include errno.h.
Reported by Tatsuro MATSUOKA.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/opendir.c

index bab5ba2..52fe92d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-14  Eric Blake  <eblake@redhat.com>
+
+       opendir: avoid compile warning
+       * lib/opendir.c (includes): Always include errno.h.
+       Reported by Tatsuro MATSUOKA.
+
 2011-09-14  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: sc_tight_scope: propagate failure from sub-make
index cb7f67c..06c611f 100644 (file)
@@ -19,6 +19,8 @@
 /* Specification.  */
 #include <dirent.h>
 
+#include <errno.h>
+
 #if HAVE_OPENDIR
 
 /* Override opendir(), to keep track of the open file descriptors.
@@ -26,7 +28,6 @@
 
 #else
 
-# include <errno.h>
 # include <stddef.h>
 # include <stdlib.h>