summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-04-25 23:43:55 +0200
committerAndreas Gruenbacher <agruen@suse.de>2010-04-27 12:38:15 +0200
commita11bfc85e551d5a6da3a0c4ee69bccd36c8de335 (patch)
tree5d53eebd29c864e431dc781060a00674e29222a1
parent37f7c8faecb6d0fb34ee9402ca157ae2b3f28902 (diff)
downloadpatch-a11bfc85e551d5a6da3a0c4ee69bccd36c8de335.tar.gz
Use the gnulib fcntl-h and sys_stat modules
* bootstrap.conf: Use the gnulib fcntl-h and sys_stat modules. * src/common.h: Remove the declarations provided by gnulib sys_stat. Always include fcntl.h (and depend on gnulib fcntl-h). * src/util.h: Remove duplicate include of <timespec.h>. * configure.ac: Remove obsolete checks for fcntl.h and utime.h.
-rw-r--r--ChangeLog8
-rw-r--r--bootstrap.conf2
-rw-r--r--configure.ac1
-rw-r--r--src/common.h61
-rw-r--r--src/util.h2
5 files changed, 11 insertions, 63 deletions
diff --git a/ChangeLog b/ChangeLog
index bd224aa..4642066 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-25 Andreas Gruenbacher <agruen@suse.de>
+
+ * bootstrap.conf: Use the gnulib fcntl-h and sys_stat modules.
+ * src/common.h: Remove the declarations provided by gnulib sys_stat.
+ Always include fcntl.h (and depend on gnulib fcntl-h).
+ * src/util.h: Remove duplicate include of <timespec.h>.
+ * configure.ac: Remove obsolete checks for fcntl.h and utime.h.
+
* src/common.h, src/patch.c, src/util.c, src/util.h: Do not declare
variables as "volatile" unnecessarily.
diff --git a/bootstrap.conf b/bootstrap.conf
index 740c8eb..1d4ddc5 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -26,6 +26,7 @@ dirname
dup2
exitfail
extensions
+fcntl-h
full-write
getdate
getopt-gnu
@@ -44,6 +45,7 @@ ssize_t
stat-time
stdbool
stdlib
+sys_stat
time
unlink
utimens
diff --git a/configure.ac b/configure.ac
index a6274a7..ee649a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,6 @@ AC_TYPE_OFF_T
# FIXME: The utime module is obsolete; replace with utimens.
gl_CHECK_TYPE_STRUCT_UTIMBUF
-AC_CHECK_HEADERS([fcntl.h utime.h])
AC_CHECK_DECLS([mktemp])
AC_CHECK_FUNCS(geteuid getuid mktemp raise sigaction sigprocmask sigsetmask)
AC_FUNC_SETMODE_DOS
diff --git a/src/common.h b/src/common.h
index a0fc49a..875313b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -31,39 +31,6 @@
#include <time.h>
#include <sys/stat.h>
-#if ! defined S_ISDIR && defined S_IFDIR
-# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-#if ! defined S_ISREG && defined S_IFREG
-# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 1
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 2
-#endif
-#ifndef S_IROTH
-#define S_IROTH 4
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP (S_IXOTH << 3)
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP (S_IWOTH << 3)
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP (S_IROTH << 3)
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR (S_IXOTH << 6)
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR (S_IWOTH << 6)
-#endif
-#ifndef S_IRUSR
-#define S_IRUSR (S_IROTH << 6)
-#endif
#include <limits.h>
@@ -213,33 +180,7 @@ extern int errno;
# endif
#endif
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-#ifndef O_WRONLY
-#define O_WRONLY 1
-#endif
-#ifndef O_RDWR
-#define O_RDWR 2
-#endif
-#ifndef _O_BINARY
-#define _O_BINARY 0
-#endif
-#ifndef O_BINARY
-#define O_BINARY _O_BINARY
-#endif
-#ifndef O_CREAT
-#define O_CREAT 0
-#endif
-#ifndef O_EXCL
-#define O_EXCL 0
-#endif
-#ifndef O_TRUNC
-#define O_TRUNC 0
-#endif
+#include <fcntl.h>
#ifdef MKDIR_TAKES_ONE_ARG
# undef mkdir
diff --git a/src/util.h b/src/util.h
index 210ddef..c45330c 100644
--- a/src/util.h
+++ b/src/util.h
@@ -22,8 +22,6 @@
#include <timespec.h>
#include <stat-time.h>
-#include <timespec.h>
-
/* An upper bound on the print length of a signed decimal line number.
Add one for the sign. */
#define LINENUM_LENGTH_BOUND (sizeof (lin) * CHAR_BIT / 3 + 1)