From 98ef1f2ddbff6c4f7904d2ba2990e5bcf8647f9d Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Tue, 19 Feb 2008 05:46:58 +0000 Subject: [PATCH] Portability: Include O_BINARY if the local platform defines it. --- lib/libarchive/archive_write_open_filename.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libarchive/archive_write_open_filename.c b/lib/libarchive/archive_write_open_filename.c index e6c92bc929fa..f0613ef4c118 100644 --- a/lib/libarchive/archive_write_open_filename.c +++ b/lib/libarchive/archive_write_open_filename.c @@ -47,6 +47,10 @@ __FBSDID("$FreeBSD$"); #include "archive.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + struct write_file_data { int fd; char filename[1]; @@ -95,7 +99,7 @@ file_open(struct archive *a, void *client_data) struct stat st; mine = (struct write_file_data *)client_data; - flags = O_WRONLY | O_CREAT | O_TRUNC; + flags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY; /* * Open the file.