summaryrefslogtreecommitdiffstats
path: root/src/ifuse.c
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-08-31 20:58:42 +0200
committerGravatar Jonathan Beck2008-08-31 20:58:42 +0200
commit7ac3d681889a6a8f9987837ace5465f2967cfff9 (patch)
treeac96888f90b8dd1bf69733f403ebd0c586917f8b /src/ifuse.c
parent95e588fae32b17debf26ceaf456b361e06011623 (diff)
downloadlibplist-7ac3d681889a6a8f9987837ace5465f2967cfff9.tar.gz
libplist-7ac3d681889a6a8f9987837ace5465f2967cfff9.tar.bz2
fix afc_getattr and more error handling in ifuse.c
Diffstat (limited to 'src/ifuse.c')
-rw-r--r--src/ifuse.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ifuse.c b/src/ifuse.c
index ed36117..c266879 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -46,7 +46,10 @@ static int ifuse_getattr(const char *path, struct stat *stbuf) {
int res = 0;
iphone_afc_client_t afc = fuse_get_context()->private_data;
- iphone_afc_get_file_attr(afc, path, stbuf);
+ iphone_error_t ret = iphone_afc_get_file_attr(afc, path, stbuf);
+
+ if (ret != IPHONE_E_SUCCESS)
+ res = -ENOENT;
return res;
}
@@ -253,19 +256,19 @@ int ifuse_ftruncate(const char *path, off_t size, struct fuse_file_info *fi) {
int ifuse_unlink(const char *path) {
iphone_afc_client_t afc = fuse_get_context()->private_data;
- if (iphone_afc_delete_file(afc, path)) return 0;
+ if (IPHONE_E_SUCCESS == iphone_afc_delete_file(afc, path)) return 0;
else return -1;
}
int ifuse_rename(const char *from, const char *to) {
iphone_afc_client_t afc = fuse_get_context()->private_data;
- if (iphone_afc_rename_file(afc, from, to)) return 0;
+ if (IPHONE_E_SUCCESS == iphone_afc_rename_file(afc, from, to)) return 0;
else return -1;
}
int ifuse_mkdir(const char *dir, mode_t ignored) {
iphone_afc_client_t afc = fuse_get_context()->private_data;
- if (iphone_afc_mkdir(afc, dir)) return 0;
+ if (IPHONE_E_SUCCESS == iphone_afc_mkdir(afc, dir)) return 0;
else return -1;
}