]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Include <io.h> and <fcntl.h> to pull in setmode(), fileno(), and O_BINARY
authorTim Kientzle <kientzle@gmail.com>
Sun, 28 Jun 2009 00:05:54 +0000 (20:05 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sun, 28 Jun 2009 00:05:54 +0000 (20:05 -0400)
for Cygwin.

SVN-Revision: 1195

configure.ac
libarchive/archive_read_open_fd.c
libarchive/archive_read_open_file.c
libarchive/archive_read_open_filename.c
libarchive/archive_write_open_fd.c

index 929eb2a2bea5ce2e5b907300a32d18d71dea3e5a..9833762d0b0d516d0f58ffcfbe0040c5865a31a5 100644 (file)
@@ -178,7 +178,7 @@ AC_HEADER_DIRENT
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS([acl/libacl.h attr/xattr.h ctype.h errno.h])
 AC_CHECK_HEADERS([ext2fs/ext2_fs.h fcntl.h grp.h])
-AC_CHECK_HEADERS([inttypes.h langinfo.h limits.h linux/fs.h])
+AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h linux/fs.h])
 AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h signal.h stdarg.h])
 AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
 AC_CHECK_HEADERS([sys/acl.h sys/extattr.h sys/ioctl.h sys/mkdev.h])
index 8fa390ac619ba94d9ce93544e93a62b463d4f00a..33912a36aef9e8c8b894fe5de5b33afd0579201a 100644 (file)
@@ -32,6 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.13 2007/06/26
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
index e589720eb3678c34996af5d7776a5f0cfbb388be..8fb65150f25b2c84d0cbd89b902756a7e5abd88c 100644 (file)
@@ -35,6 +35,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_file.c,v 1.20 2007/06/2
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
@@ -95,7 +98,7 @@ archive_read_open_FILE(struct archive *a, FILE *f)
                mine->can_skip = 0;
 
 #if defined(__CYGWIN__)
-       setmode(_fileno(mine->f), O_BINARY);
+       setmode(fileno(mine->f), O_BINARY);
 #elif defined(_WIN32)
        _setmode(_fileno(mine->f), _O_BINARY);
 #endif
index b04e579b5072a623a934de8f2d6d458b17dc5408..375339e3cf4495dacc7c2d5b331ba40117a9fb45 100644 (file)
@@ -35,6 +35,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.21 2008/
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
index 5ebac81d5cbf34a25fb32179fe3005c5403a5cde..152403209bde7af5db76d05cbba0f53d2d685edf 100644 (file)
@@ -32,6 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_fd.c,v 1.9 2007/01/09
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif