summaryrefslogtreecommitdiff
path: root/mkfs/options.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-08 14:53:30 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-08 14:53:30 +0200
commit3a851dfe87c88ac1d4dddc2a26cc48b037f852f9 (patch)
treea8a8f34291aa58b25737088d247a91a7f60b4fec /mkfs/options.c
parent60064dd0412a149fe00cfc4e2f2361c22656db57 (diff)
Replace direct file I/O with abstraction layer
This should make it easier to use libsquashfs with custom setups that embedd a squashfs image inside something else. Also, it should make it easier to port to non unix-like platforms. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/options.c')
-rw-r--r--mkfs/options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mkfs/options.c b/mkfs/options.c
index 9e747d8..7b83ec4 100644
--- a/mkfs/options.c
+++ b/mkfs/options.c
@@ -146,7 +146,7 @@ void process_command_line(options_t *opt, int argc, char **argv)
int i;
memset(opt, 0, sizeof(*opt));
- opt->outmode = O_WRONLY | O_CREAT | O_EXCL;
+ opt->outmode = 0;
opt->compressor = compressor_get_default();
opt->blksz = SQFS_DEFAULT_BLOCK_SIZE;
opt->devblksz = SQFS_DEVBLK_SIZE;
@@ -207,7 +207,7 @@ void process_command_line(options_t *opt, int argc, char **argv)
opt->exportable = true;
break;
case 'f':
- opt->outmode = O_WRONLY | O_CREAT | O_TRUNC;
+ opt->outmode |= SQFS_FILE_OPEN_OVERWRITE;
break;
case 'q':
opt->quiet = true;