Remove references to O_BINARY
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 4 Apr 2015 21:11:29 +0000 (23:11 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 8 Apr 2015 05:51:39 +0000 (07:51 +0200)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
libsparse/output_file.c
make_ext4fs.c
make_ext4fs_main.c

index cd3080038118245e53e352bb676f30cd943c5578..ba92563dd3da11117c8f8308ba805165289dfdc7 100644 (file)
@@ -24,6 +24,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include "sparse_crc32.h"
 #include "sparse_format.h"
 
-#ifndef USE_MINGW
-#include <sys/mman.h>
-#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;
        }
index 3623426d03e6e653a95cad759ba77685e1ca1737..7fffd47ab42a23a7e9b1850e7ca3bb0e1881ee7b 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#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;
index 57d263b500b1174b05eae63b5c0ae1de1e41476a..58853d19a6cdea7bb17a727e7a0d2d5ff83f54ae 100644 (file)
 #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;