#include "extent.h"
#include "indirect.h"
-#ifdef USE_MINGW
-#define S_IFLNK 0 /* used by make_link, not needed under mingw */
-#endif
-
static struct block_allocation* saved_allocation_head = NULL;
struct block_allocation* get_saved_allocation_chain() {
#include <stddef.h>
#include <string.h>
-#ifdef USE_MINGW
-#include <winsock2.h>
-#else
#include <arpa/inet.h>
#include <sys/ioctl.h>
-#endif
#if defined(__linux__)
#include <linux/fs.h>
int is_block_device_fd(int fd)
{
-#ifdef USE_MINGW
- return 0;
-#else
struct stat st;
int ret = fstat(fd, &st);
if (ret < 0)
return 0;
return S_ISBLK(st.st_mode);
-#endif
}
u64 get_file_size(int fd)
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
-#ifndef USE_MINGW
-#include <sys/mman.h>
-#endif
-
#if defined(__APPLE__) && defined(__MACH__)
#define lseek64 lseek
#define off64_t off_t
aligned_diff = offset - aligned_offset;
buffer_size = len + aligned_diff;
-#ifndef USE_MINGW
char *data = mmap64(NULL, buffer_size, PROT_READ, MAP_SHARED, fd,
aligned_offset);
if (data == MAP_FAILED) {
return -errno;
}
ptr = data + aligned_diff;
-#else
- off64_t pos;
- char *data = malloc(len);
- if (!data) {
- return -errno;
- }
- pos = lseek64(fd, offset, SEEK_SET);
- if (pos < 0) {
- free(data);
- return -errno;
- }
- ret = read_all(fd, data, len);
- if (ret < 0) {
- free(data);
- return ret;
- }
- ptr = data;
-#endif
ret = out->sparse_ops->write_data_chunk(out, len, ptr);
-#ifndef USE_MINGW
munmap(data, buffer_size);
-#else
- free(data);
-#endif
return ret;
}
s = " at ";
}
if (verbose) {
-#ifndef USE_MINGW
if (err == -EOVERFLOW) {
sparse_print_verbose("EOF while reading file%s%s\n", s, at);
- } else
-#endif
- if (err == -EINVAL) {
+ } else if (err == -EINVAL) {
sparse_print_verbose("Invalid sparse file format%s%s\n", s, at);
} else if (err == -ENOMEM) {
sparse_print_verbose("Failed allocation while reading file%s%s\n",
return root_inode;
}
-#ifndef USE_MINGW
/* Read a local directory and create the same tree in the generated filesystem.
Calls itself recursively with each directory in the given directory.
full_path is an absolute or relative path, with a trailing slash, to the
free(dentries);
return inode;
}
-#endif
static u32 compute_block_size()
{
if (info.feat_compat & EXT4_FEATURE_COMPAT_RESIZE_INODE)
ext4_create_resize_inode();
-#ifdef USE_MINGW
- // Windows needs only 'create an empty fs image' functionality
- assert(!directory);
- root_inode_num = build_default_directory_structure(mountpoint);
-#else
if (directory)
root_inode_num = build_directory_structure(directory, mountpoint, 0,
fs_config_func, verbose, fixed_time);
else
root_inode_num = build_default_directory_structure(mountpoint);
-#endif
root_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
inode_set_permissions(root_inode_num, root_mode, 0, 0, 0);
#define SHA1HANDSOFF /* Copies data before messing with it. */
-#ifndef USE_MINGW
#include <sys/cdefs.h>
-#endif
#include <sys/types.h>
#include <assert.h>
#include <string.h>
#define _SYS_SHA1_H_
#include <sys/types.h>
-#include <stdint.h>
-
-#ifdef USE_MINGW
-typedef unsigned char u_char;
-typedef unsigned int uint32_t;
-typedef unsigned int u_int32_t;
-typedef unsigned int u_int;
-
-#define __BEGIN_DECLS
-#define __END_DECLS
-#else
#include <sys/cdefs.h>
-#endif
+#include <stdint.h>
#define SHA1_DIGEST_LENGTH 20
#define SHA1_DIGEST_STRING_LENGTH 41
#include <string.h>
-#ifdef USE_MINGW
-#include <winsock2.h>
-#else
#include <arpa/inet.h>
-#endif
#include "ext4_utils.h"
#include "sha1.h"