From fe8f2ce6f493b26c21d7d5fa1a5ffe248945721f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 4 Apr 2015 23:11:29 +0200 Subject: [PATCH] Remove references to O_BINARY Signed-off-by: Jo-Philipp Wich --- libsparse/output_file.c | 10 ++-------- make_ext4fs.c | 8 +------- make_ext4fs_main.c | 6 +----- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/libsparse/output_file.c b/libsparse/output_file.c index cd30800..ba92563 100644 --- a/libsparse/output_file.c +++ b/libsparse/output_file.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -34,13 +35,6 @@ #include "sparse_crc32.h" #include "sparse_format.h" -#ifndef USE_MINGW -#include -#define O_BINARY 0 -#else -#define ftruncate64 ftruncate -#endif - #if defined(__APPLE__) && defined(__MACH__) #define lseek64 lseek #define ftruncate64 ftruncate @@ -748,7 +742,7 @@ int write_file_chunk(struct output_file *out, unsigned int len, { int ret; - int file_fd = open(file, O_RDONLY | O_BINARY); + int file_fd = open(file, O_RDONLY); if (file_fd < 0) { return -errno; } diff --git a/make_ext4fs.c b/make_ext4fs.c index 3623426..7fffd47 100644 --- a/make_ext4fs.c +++ b/make_ext4fs.c @@ -35,12 +35,6 @@ #include #include -#ifndef USE_MINGW - -#define O_BINARY 0 - -#endif - /* TODO: Not implemented: Allocating blocks in the same block group as the file inode Hash or binary tree directories @@ -364,7 +358,7 @@ int make_ext4fs(const char *filename, long long len, reset_ext4fs_info(); info.len = len; - fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); + fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd < 0) { error_errno("open"); return EXIT_FAILURE; diff --git a/make_ext4fs_main.c b/make_ext4fs_main.c index 57d263b..58853d1 100644 --- a/make_ext4fs_main.c +++ b/make_ext4fs_main.c @@ -33,10 +33,6 @@ #include "ext4_utils.h" #include "canned_fs_config.h" -#ifndef USE_MINGW /* O_BINARY is windows-specific flag */ -#define O_BINARY 0 -#endif - extern struct fs_info info; @@ -181,7 +177,7 @@ int main(int argc, char **argv) } if (strcmp(filename, "-")) { - fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); + fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd < 0) { perror("open"); return EXIT_FAILURE; -- 2.11.0