diff options
author | Zoltan Balaton | 2009-01-13 22:21:03 -0800 |
---|---|---|
committer | Matt Colyer | 2009-01-13 22:21:03 -0800 |
commit | 54311c89363d1d5ed375370635a17d96f141393c (patch) | |
tree | f52c11e314dfeba79f6754b014a1abe7f1ee9258 | |
parent | b0412bfdaa33c9876893e529cec5b9f3ea176022 (diff) | |
download | ifuse-54311c89363d1d5ed375370635a17d96f141393c.tar.gz ifuse-54311c89363d1d5ed375370635a17d96f141393c.tar.bz2 |
Correctly handle file modes.
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | src/ifuse.c | 8 |
2 files changed, 6 insertions, 3 deletions
@@ -4,3 +4,4 @@ Matt Colyer Martin Aumueller Christophe Fergeau Paul Sladen +Zoltan Balaton diff --git a/src/ifuse.c b/src/ifuse.c index 1db04ad..670a458 100644 --- a/src/ifuse.c +++ b/src/ifuse.c @@ -82,7 +82,7 @@ static int ifuse_create(const char *path, mode_t mode, struct fuse_file_info *fi uint32 *argh_filehandle = (uint32 *) malloc(sizeof(uint32)); iphone_afc_client_t afc = fuse_get_context()->private_data; - iphone_afc_open_file(afc, path, IPHONE_AFC_FILE_WRITE, &file); + iphone_afc_open_file(afc, path, IPHONE_AFC_FILE_WRITE | IPHONE_AFC_FILE_CREAT, &file); *argh_filehandle = iphone_afc_get_file_handle(file); fi->fh = *argh_filehandle; g_hash_table_insert(file_handles, argh_filehandle, file); @@ -96,8 +96,10 @@ static int ifuse_open(const char *path, struct fuse_file_info *fi) iphone_afc_client_t afc = fuse_get_context()->private_data; uint32_t mode = 0; - if ((fi->flags & 3) == O_RDWR || (fi->flags & 3) == O_WRONLY) { - mode = IPHONE_AFC_FILE_READ; + if ((fi->flags & 3) == O_RDWR) { + mode = IPHONE_AFC_FILE_RW; + } else if ((fi->flags & 3) == O_WRONLY) { + mode = IPHONE_AFC_FILE_WRITE; } else if ((fi->flags & 3) == O_RDONLY) { mode = IPHONE_AFC_FILE_READ; } else { |