summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AFC.c5
-rw-r--r--src/ifuse.c11
2 files changed, 10 insertions, 6 deletions
diff --git a/src/AFC.c b/src/AFC.c
index 3828519..b475a06 100644
--- a/src/AFC.c
+++ b/src/AFC.c
@@ -593,7 +593,7 @@ iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path
593 */ 593 */
594iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf ) { 594iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char *filename, struct stat *stbuf ) {
595 595
596 int ret = IPHONE_E_SUCCESS; 596 iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR;
597 if (!client ||!client->connection || !client->afc_packet || !stbuf) return IPHONE_E_INVALID_ARG; 597 if (!client ||!client->connection || !client->afc_packet || !stbuf) return IPHONE_E_INVALID_ARG;
598 598
599 memset(stbuf, 0, sizeof(struct stat)); 599 memset(stbuf, 0, sizeof(struct stat));
@@ -608,8 +608,9 @@ iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char
608 stbuf->st_uid = getuid(); 608 stbuf->st_uid = getuid();
609 stbuf->st_gid = getgid(); 609 stbuf->st_gid = getgid();
610 610
611 iphone_afc_close_file(client,file); 611 ret = iphone_afc_close_file(client,file);
612 } 612 }
613 return ret;
613} 614}
614 615
615/** Opens a file on the phone. 616/** Opens a file on the phone.
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) {
46 int res = 0; 46 int res = 0;
47 47
48 iphone_afc_client_t afc = fuse_get_context()->private_data; 48 iphone_afc_client_t afc = fuse_get_context()->private_data;
49 iphone_afc_get_file_attr(afc, path, stbuf); 49 iphone_error_t ret = iphone_afc_get_file_attr(afc, path, stbuf);
50
51 if (ret != IPHONE_E_SUCCESS)
52 res = -ENOENT;
50 53
51 return res; 54 return res;
52} 55}
@@ -253,19 +256,19 @@ int ifuse_ftruncate(const char *path, off_t size, struct fuse_file_info *fi) {
253 256
254int ifuse_unlink(const char *path) { 257int ifuse_unlink(const char *path) {
255 iphone_afc_client_t afc = fuse_get_context()->private_data; 258 iphone_afc_client_t afc = fuse_get_context()->private_data;
256 if (iphone_afc_delete_file(afc, path)) return 0; 259 if (IPHONE_E_SUCCESS == iphone_afc_delete_file(afc, path)) return 0;
257 else return -1; 260 else return -1;
258} 261}
259 262
260int ifuse_rename(const char *from, const char *to) { 263int ifuse_rename(const char *from, const char *to) {
261 iphone_afc_client_t afc = fuse_get_context()->private_data; 264 iphone_afc_client_t afc = fuse_get_context()->private_data;
262 if (iphone_afc_rename_file(afc, from, to)) return 0; 265 if (IPHONE_E_SUCCESS == iphone_afc_rename_file(afc, from, to)) return 0;
263 else return -1; 266 else return -1;
264} 267}
265 268
266int ifuse_mkdir(const char *dir, mode_t ignored) { 269int ifuse_mkdir(const char *dir, mode_t ignored) {
267 iphone_afc_client_t afc = fuse_get_context()->private_data; 270 iphone_afc_client_t afc = fuse_get_context()->private_data;
268 if (iphone_afc_mkdir(afc, dir)) return 0; 271 if (IPHONE_E_SUCCESS == iphone_afc_mkdir(afc, dir)) return 0;
269 else return -1; 272 else return -1;
270} 273}
271 274