summaryrefslogtreecommitdiffstats
path: root/src/ifuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ifuse.c')
-rw-r--r--src/ifuse.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ifuse.c b/src/ifuse.c
index f768423..6d2bae0 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -57,7 +57,7 @@ static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
57 char **dirs; 57 char **dirs;
58 iphone_afc_client_t afc = fuse_get_context()->private_data; 58 iphone_afc_client_t afc = fuse_get_context()->private_data;
59 59
60 dirs = iphone_afc_get_dir_list(afc, path); 60 iphone_afc_get_dir_list(afc, path, &dirs);
61 61
62 if(!dirs) 62 if(!dirs)
63 return -ENOENT; 63 return -ENOENT;
@@ -119,8 +119,8 @@ static int ifuse_read(const char *path, char *buf, size_t size, off_t offset,
119 return -ENOENT; 119 return -ENOENT;
120 } 120 }
121 121
122 bytes = iphone_afc_seek_file(afc, file, offset); 122 if (IPHONE_E_SUCCESS == iphone_afc_seek_file(afc, file, offset))
123 bytes = iphone_afc_read_file(afc, file, buf, size); 123 iphone_afc_read_file(afc, file, buf, size, &bytes);
124 return bytes; 124 return bytes;
125} 125}
126 126
@@ -134,8 +134,8 @@ static int ifuse_write(const char *path, const char *buf, size_t size, off_t off
134 file = g_hash_table_lookup(file_handles, &(fi->fh)); 134 file = g_hash_table_lookup(file_handles, &(fi->fh));
135 if (!file) return -ENOENT; 135 if (!file) return -ENOENT;
136 136
137 bytes = iphone_afc_seek_file(afc, file, offset); 137 if (IPHONE_E_SUCCESS == iphone_afc_seek_file(afc, file, offset))
138 bytes = iphone_afc_write_file(afc, file, buf, size); 138 iphone_afc_write_file(afc, file, buf, size, &bytes);
139 return bytes; 139 return bytes;
140} 140}
141 141
@@ -179,8 +179,7 @@ void *ifuse_init(struct fuse_conn_info *conn) {
179 return NULL; 179 return NULL;
180 } 180 }
181 181
182 port = iphone_lckd_start_service(control, "com.apple.afc"); 182 if (IPHONE_E_SUCCESS == iphone_lckd_start_service(control, "com.apple.afc", &port) && !port) {
183 if (!port) {
184 iphone_lckd_free_client(control); 183 iphone_lckd_free_client(control);
185 iphone_free_device(phone); 184 iphone_free_device(phone);
186 fprintf(stderr, "Something went wrong when starting AFC."); 185 fprintf(stderr, "Something went wrong when starting AFC.");
@@ -206,9 +205,10 @@ int ifuse_flush(const char *path, struct fuse_file_info *fi) {
206 205
207int ifuse_statfs(const char *path, struct statvfs *stats) { 206int ifuse_statfs(const char *path, struct statvfs *stats) {
208 iphone_afc_client_t afc = fuse_get_context()->private_data; 207 iphone_afc_client_t afc = fuse_get_context()->private_data;
209 char **info_raw = iphone_afc_get_devinfo(afc); 208 char **info_raw = NULL;
210 uint32_t totalspace = 0, freespace = 0, blocksize = 0, i = 0; 209 uint32_t totalspace = 0, freespace = 0, blocksize = 0, i = 0;
211 210
211 iphone_afc_get_devinfo(afc, &info_raw);
212 if (!info_raw) return -ENOENT; 212 if (!info_raw) return -ENOENT;
213 213
214 for (i = 0; info_raw[i]; i++) { 214 for (i = 0; info_raw[i]; i++) {