#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
- Special files: sockets, devices, fifos
*/
static int filter_dot(const struct dirent *d)
}
uint64_t capabilities;
if (fs_config_func != NULL) {
-#ifdef ANDROID
unsigned int mode = 0;
unsigned int uid = 0;
unsigned int gid = 0;
dentries[i].uid = uid;
dentries[i].gid = gid;
dentries[i].capabilities = capabilities;
-#else
- error("can't set android permissions - built without android support");
-#endif
}
if (S_ISREG(stat.st_mode)) {
free(subdir_dir_path);
} else if (dentries[i].file_type == EXT4_FT_SYMLINK) {
entry_inode = make_link(dentries[i].link);
+ } else if (dentries[i].file_type == EXT4_FT_CHRDEV ||
+ dentries[i].file_type == EXT4_FT_BLKDEV ||
+ dentries[i].file_type == EXT4_FT_SOCK ||
+ dentries[i].file_type == EXT4_FT_FIFO) {
+ entry_inode = make_special(dentries[i].full_path);
} else {
error("unknown file type on %s", dentries[i].path);
entry_inode = 0;
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;