summaryrefslogtreecommitdiffstats
path: root/src/ifuse.c
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-08-31 18:31:21 +0200
committerGravatar Jonathan Beck2008-08-31 19:33:19 +0200
commit8333ca944cc56b4da1ab418c0b890f96f5135210 (patch)
tree63792ef9d2786d23b53e47dd8af9f9055c1a6bef /src/ifuse.c
parent86f61988990daa30c8564e2b26666dd442bd6e65 (diff)
downloadlibimobiledevice-8333ca944cc56b4da1ab418c0b890f96f5135210.tar.gz
libimobiledevice-8333ca944cc56b4da1ab418c0b890f96f5135210.tar.bz2
use new function signature and few bugfixes.
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,
char **dirs;
iphone_afc_client_t afc = fuse_get_context()->private_data;
- dirs = iphone_afc_get_dir_list(afc, path);
+ iphone_afc_get_dir_list(afc, path, &dirs);
if(!dirs)
return -ENOENT;
@@ -119,8 +119,8 @@ static int ifuse_read(const char *path, char *buf, size_t size, off_t offset,
return -ENOENT;
}
- bytes = iphone_afc_seek_file(afc, file, offset);
- bytes = iphone_afc_read_file(afc, file, buf, size);
+ if (IPHONE_E_SUCCESS == iphone_afc_seek_file(afc, file, offset))
+ iphone_afc_read_file(afc, file, buf, size, &bytes);
return bytes;
}
@@ -134,8 +134,8 @@ static int ifuse_write(const char *path, const char *buf, size_t size, off_t off
file = g_hash_table_lookup(file_handles, &(fi->fh));
if (!file) return -ENOENT;
- bytes = iphone_afc_seek_file(afc, file, offset);
- bytes = iphone_afc_write_file(afc, file, buf, size);
+ if (IPHONE_E_SUCCESS == iphone_afc_seek_file(afc, file, offset))
+ iphone_afc_write_file(afc, file, buf, size, &bytes);
return bytes;
}
@@ -179,8 +179,7 @@ void *ifuse_init(struct fuse_conn_info *conn) {
return NULL;
}
- port = iphone_lckd_start_service(control, "com.apple.afc");
- if (!port) {
+ if (IPHONE_E_SUCCESS == iphone_lckd_start_service(control, "com.apple.afc", &port) && !port) {
iphone_lckd_free_client(control);
iphone_free_device(phone);
fprintf(stderr, "Something went wrong when starting AFC.");
@@ -206,9 +205,10 @@ int ifuse_flush(const char *path, struct fuse_file_info *fi) {
int ifuse_statfs(const char *path, struct statvfs *stats) {
iphone_afc_client_t afc = fuse_get_context()->private_data;
- char **info_raw = iphone_afc_get_devinfo(afc);
+ char **info_raw = NULL;
uint32_t totalspace = 0, freespace = 0, blocksize = 0, i = 0;
+ iphone_afc_get_devinfo(afc, &info_raw);
if (!info_raw) return -ENOENT;
for (i = 0; info_raw[i]; i++) {