summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-09-18 10:35:01 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-09-18 10:35:01 +0000
commit20f20c4c8080e6abfb30662010ee4658e4230d14 (patch)
tree3dcfcfbba2933f0a57fe743d3d9c33fc75777765
parentac5dbed7235d5f6e7284329b164c0e271fc91297 (diff)
downloadquilt-20f20c4c8080e6abfb30662010ee4658e4230d14.tar.gz
- lib/backup-files.c: use mktemp if mkstemp is not available
(Gary V. Vaughan <gary@gnu.org>). Add a config.h.
-rw-r--r--.cvsignore2
-rw-r--r--config.h.in78
-rw-r--r--configure.ac4
-rw-r--r--lib/backup-files.c5
-rw-r--r--quilt.changes6
5 files changed, 93 insertions, 2 deletions
diff --git a/.cvsignore b/.cvsignore
index 055caa7..ab590c1 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-README build-stamp configure-stamp quilt.spec *.tar.gz configure Makefile autom4te.cache config.log config.status
+README build-stamp configure-stamp quilt.spec *.tar.gz configure Makefile autom4te.cache config.log config.status config.h
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..3e55591
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,78 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkdir' function. */
+#undef HAVE_MKDIR
+
+/* Define to 1 if you have the `mkstemp' function. */
+#undef HAVE_MKSTEMP
+
+/* Define to 1 if you have the `mktemp' function. */
+#undef HAVE_MKTEMP
+
+/* Define to 1 if you have the `rmdir' function. */
+#undef HAVE_RMDIR
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+#undef HAVE_STAT_EMPTY_STRING_BUG
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
diff --git a/configure.ac b/configure.ac
index ad4098c..5cf58e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,13 +2,14 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT([quilt],[0.42],[quilt-dev@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
-AC_REVISION ($Revision: 1.45 $)
+AC_REVISION ($Revision: 1.46 $)
PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)
dnl Setup for backup-files compilation
AC_HEADER_STDC
+AC_CHECK_FUNCS([mkstemp mktemp], break)
AC_CHECK_FUNCS([mkdir])
AC_CHECK_FUNCS([rmdir])
AC_CHECK_FUNCS([strchr])
@@ -223,6 +224,7 @@ AC_SUBST(RPMBUILD)
AC_SUBST(COMPAT_SYMLINKS)
AC_SUBST(COMPAT_PROGRAMS)
+AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
diff --git a/lib/backup-files.c b/lib/backup-files.c
index 53ebc25..3d2d183 100644
--- a/lib/backup-files.c
+++ b/lib/backup-files.c
@@ -27,6 +27,7 @@
#define _GNU_SOURCE
+#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <utime.h>
@@ -38,6 +39,10 @@
#include <string.h>
#include <ftw.h>
+#if !defined(HAVE_MKSTEMP) && defined(HAVE_MKTEMP)
+# define mkstemp(x) creat(mktemp(x), 0600)
+#endif
+
const char *progname;
enum { what_noop, what_backup, what_restore, what_remove };
diff --git a/quilt.changes b/quilt.changes
index 274ecc8..60746bd 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Sun Sep 18 12:32:41 CEST 2005 - agruen@suse.de
+
+- lib/backup-files.c: use mktemp if mkstemp is not available
+ (Gary V. Vaughan <gary@gnu.org>). Add a config.h.
+
+-------------------------------------------------------------------
Sun Sep 18 12:12:47 CEST 2005 - agruen@suse.de
- lib/backup-files.c: switch from alloca to malloc for portability.