finalise NEWS.stable
[gnulib.git] / lib / openat.c
index a12fe20..354ff80 100644 (file)
@@ -46,10 +46,7 @@ orig_openat (int fd, char const *filename, int flags, mode_t mode)
 #include <stddef.h>
 #include <string.h>
 #include <sys/stat.h>
-
-#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "openat-priv.h"
-#include "save-cwd.h"
+#include <errno.h>
 
 #if HAVE_OPENAT
 
@@ -144,6 +141,10 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
 
 #else /* !HAVE_OPENAT */
 
+# include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+# include "openat-priv.h"
+# include "save-cwd.h"
+
 /* Replacement for Solaris' openat function.
    <http://www.google.com/search?q=openat+site:docs.sun.com>
    First, try to simulate it via open ("/proc/self/fd/FD/FILE").