aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-02-08 09:28:51 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-02-08 09:28:51 +0000
commit031090eb8eca0e1e3b4f14bd083e123dfdbffe9e (patch)
treee6b2f09fef5f7481f019c9b7fe460ab1bbac41fe /src
parent8093c893237cc5b67422d5b59db0c44acb5b2bd1 (diff)
downloadcpio-031090eb8eca0e1e3b4f14bd083e123dfdbffe9e.tar.gz
cpio-031090eb8eca0e1e3b4f14bd083e123dfdbffe9e.tar.bz2
Fix mingw build. Thanks to Robert Millan.
* NEWS, THANKS: Update. * bootstrap: Create lib/system.c, m4/sysdep.m4, update lib/system.h. * mingw.m4, sysdep.m4: New files. * configure.ac: Raise version number to 2.9.90. Call CPIO_SYSDEP. Remove the call to gl_USE_SYSTEM_EXTENSIONS. (AC_CHECK_HEADERS): Add process.h sys/ioctl.h * lib/Makefile.am (libcpio_a_SOURCES): Add system.c * src/idcache.c: Include system.h * src/userspec.c: Remove alloca stuff (already handled by gnulib). Include alloca.h. Remove useless declarations of get.* functions. * src/util.c: Include sys/ioctl.h conditionally.
Diffstat (limited to 'src')
-rw-r--r--src/idcache.c4
-rw-r--r--src/userspec.c26
-rw-r--r--src/util.c9
3 files changed, 9 insertions, 30 deletions
diff --git a/src/idcache.c b/src/idcache.c
index 1e57dd3..069aa71 100644
--- a/src/idcache.c
+++ b/src/idcache.c
@@ -23,10 +23,10 @@
#include <stdio.h>
#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
#include <xalloc.h>
+#include <system.h>
+
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
#else
diff --git a/src/userspec.c b/src/userspec.c
index ccd2eb5..045448b 100644
--- a/src/userspec.c
+++ b/src/userspec.c
@@ -20,36 +20,10 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#include <system.h>
-
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#ifdef HAVE_ALLOCA_H
#include <alloca.h>
-#else
-#ifdef _AIX
- #pragma alloca
-#else
-char *alloca ();
-#endif
-#endif
-#endif
-
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
-
-#if !HAVE_DECL_GETPWNAM
-extern struct passwd *getpwnam (const char *name);
-#endif
-#if !HAVE_DECL_GETGRNAM
-extern struct group *getgrnam (const char *name);
-#endif
-#if !HAVE_DECL_GETGRGID
-extern struct group *getgrgid (gid_t gid);
-#endif
#ifndef HAVE_ENDPWENT
# define endpwent()
diff --git a/src/util.c b/src/util.c
index e93b9bd..2732f37 100644
--- a/src/util.c
+++ b/src/util.c
@@ -33,7 +33,9 @@
#include <hash.h>
#include <utimens.h>
-#include <sys/ioctl.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
#ifdef HAVE_SYS_MTIO_H
# ifdef HAVE_SYS_IO_TRIOCTL_H
@@ -1266,7 +1268,10 @@ stat_to_cpio (struct cpio_file_stat *hdr, struct stat *st)
}
#ifndef HAVE_FCHOWN
-# define fchown(fd, uid, gid) (-1)
+# define HAVE_FCHOWN 0
+#endif
+#ifndef HAVE_FCHMOD
+# define HAVE_FCHMOD 0
#endif
int

Return to:

Send suggestions and report system problems to the System administrator.