#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
{
int ret;
- int file_fd = open(file, O_RDONLY | O_BINARY);
+ int file_fd = open(file, O_RDONLY);
if (file_fd < 0) {
return -errno;
}
#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
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;
#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;
}
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;