From d1eb42bdbbaf00d38b2a479e9aa40207b79bd090 Mon Sep 17 00:00:00 2001
From: Jim Meyering <jim@meyering.net>
Date: Sat, 2 Jul 2005 09:45:07 +0000
Subject: [PATCH] Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
 and don't include <sys/file.h>).

---
 lib/ChangeLog         | 8 ++++++++
 lib/chown.c           | 6 +-----
 lib/cloexec.c         | 4 +---
 lib/dup-safer.c       | 4 +---
 lib/dup2.c            | 4 +---
 lib/fsusage.c         | 4 +---
 lib/getcwd.c          | 4 +---
 lib/getloadavg.c      | 6 +-----
 lib/mountlist.c       | 4 +---
 lib/openat.h          | 4 +---
 lib/pagealign_alloc.c | 4 +---
 lib/save-cwd.c        | 6 +-----
 lib/tempname.c        | 4 +---
 13 files changed, 20 insertions(+), 42 deletions(-)

diff --git a/lib/ChangeLog b/lib/ChangeLog
index 5597602928..0805ca7ef7 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,11 @@
+2005-07-01  Jim Meyering  <jim@meyering.net>
+
+	* chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
+	* getloadavg.c, mountlist.c, openat.h, pagealign_alloc.c:
+	* save-cwd.c, tempname.c:
+	Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
+	and don't include <sys/file.h>).
+
 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
diff --git a/lib/chown.c b/lib/chown.c
index ae6a504a79..2d97902e63 100644
--- a/lib/chown.c
+++ b/lib/chown.c
@@ -30,11 +30,7 @@
 #if HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#else
-# include <sys/file.h>
-#endif
+#include <fcntl.h>
 #include <errno.h>
 
 /* Provide a more-closely POSIX-conforming version of chown on
diff --git a/lib/cloexec.c b/lib/cloexec.c
index bc55d75214..79d4ed0b8d 100644
--- a/lib/cloexec.c
+++ b/lib/cloexec.c
@@ -27,9 +27,7 @@
 # include <unistd.h>
 #endif
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #ifndef FD_CLOEXEC
 # define FD_CLOEXEC 1
diff --git a/lib/dup-safer.c b/lib/dup-safer.c
index e51a8d5f57..034297aa1e 100644
--- a/lib/dup-safer.c
+++ b/lib/dup-safer.c
@@ -23,9 +23,7 @@
 
 #include "unistd-safer.h"
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #if HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/lib/dup2.c b/lib/dup2.c
index c5d418f022..77deaf62d0 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -23,9 +23,7 @@
 
 #include <errno.h>
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #if HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/lib/fsusage.c b/lib/fsusage.c
index 972d88f122..83d26af88b 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -60,9 +60,7 @@
 # include <sys/filsys.h>	/* SVR2 */
 #endif
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #if HAVE_SYS_STATFS_H
 # include <sys/statfs.h>
diff --git a/lib/getcwd.c b/lib/getcwd.c
index 94e5ba3b55..86070ead87 100644
--- a/lib/getcwd.c
+++ b/lib/getcwd.c
@@ -30,9 +30,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 
-#if HAVE_FCNTL_H
-# include <fcntl.h> /* For AT_FDCWD on Solaris 9.  */
-#endif
+#include <fcntl.h> /* For AT_FDCWD on Solaris 9.  */
 
 #ifndef __set_errno
 # define __set_errno(val) (errno = (val))
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 8fe542fbb1..d1ed95af48 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -447,11 +447,7 @@
 #  include <sys/dg_sys_info.h>
 # endif
 
-# if defined (HAVE_FCNTL_H) || defined (_POSIX_VERSION)
-#  include <fcntl.h>
-# else
-#  include <sys/file.h>
-# endif
+# include <fcntl.h>
 
 # include "unistd-safer.h"
 
diff --git a/lib/mountlist.c b/lib/mountlist.c
index 129e0a438e..a8ef87d8c8 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -35,9 +35,7 @@ char *strstr ();
 
 #include <errno.h>
 
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/lib/openat.h b/lib/openat.h
index 6639f732a0..76ad46bdb0 100644
--- a/lib/openat.h
+++ b/lib/openat.h
@@ -17,9 +17,7 @@
 
 /* written by Jim Meyering */
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c
index ab36c932f8..28e8209f71 100644
--- a/lib/pagealign_alloc.c
+++ b/lib/pagealign_alloc.c
@@ -28,9 +28,7 @@
 #include <errno.h>
 #include <stdlib.h>
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #if HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/lib/save-cwd.c b/lib/save-cwd.c
index b3d09965db..5ad790a4d3 100644
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -33,11 +33,7 @@
 # include <unistd.h>
 #endif
 
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#else
-# include <sys/file.h>
-#endif
+#include <fcntl.h>
 
 #include <errno.h>
 
diff --git a/lib/tempname.c b/lib/tempname.c
index eda6235aea..4b0fad3f87 100644
--- a/lib/tempname.c
+++ b/lib/tempname.c
@@ -47,9 +47,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#if HAVE_FCNTL_H || _LIBC
-# include <fcntl.h>
-#endif
+#include <fcntl.h>
 
 #if HAVE_SYS_TIME_H || _LIBC
 # include <sys/time.h>
-- 
2.39.5