summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Aumueller2008-07-30 23:11:24 +0200
committerGravatar Matt Colyer2008-07-30 21:31:09 -0700
commitc9adedcc6ebd6e18572f794564b76d2080c1bd1c (patch)
tree87d2d4d12c06702be6c98ece522e2da58b871b03 /src
parent2a406b92bc5e8d8d0b5c6cd78327b3d08a8bbeff (diff)
downloadlibimobiledevice-c9adedcc6ebd6e18572f794564b76d2080c1bd1c.tar.gz
libimobiledevice-c9adedcc6ebd6e18572f794564b76d2080c1bd1c.tar.bz2
ifuse_init has to return a void* (fuse 2.7.2 on hardy heron)
Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src')
-rw-r--r--src/ifuse.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ifuse.c b/src/ifuse.c
index eb124af..1cfa48d 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -17,7 +17,7 @@
#include "AFC.h"
-AFClient *afc;
+AFClient *afc = NULL;
GHashTable *file_handles;
int fh_index = 0;
@@ -85,7 +85,7 @@ static int ifuse_read(const char *path, char *buf, size_t size, off_t offset,
return bytes;
}
-void ifuse_init(struct fuse_conn_info *conn) {
+void *ifuse_init(struct fuse_conn_info *conn) {
char *response = (char*)malloc(sizeof(char) * 2048);
int bytes = 0, port = 0, i = 0;
@@ -94,27 +94,29 @@ void ifuse_init(struct fuse_conn_info *conn) {
iPhone *phone = get_iPhone();
if (!phone){
fprintf(stderr, "No iPhone found, is it connected?\n");
- return -1;
+ return NULL;
}
lockdownd_client *control = new_lockdownd_client(phone);
if (!lockdownd_hello(control)) {
fprintf(stderr, "Something went wrong in the lockdownd client.\n");
- return -1;
+ return NULL;
}
//if (!lockdownd_start_SSL_session(control, "29942970-207913891623273984")) {
fprintf(stderr, "Something went wrong in GnuTLS.\n");
- return -1;
+ return NULL;
}
port = lockdownd_start_service(control, "com.apple.afc");
if (!port) {
fprintf(stderr, "Something went wrong when starting AFC.");
+ return NULL;
}
afc = afc_connect(phone, 3432, port);
-
+
+ return afc;
}
void ifuse_cleanup() {