summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-03-08 12:05:21 -0700
committerGravatar Matt Colyer2009-03-08 12:05:51 -0700
commit8d6eebb99d23ffb139b311b60d6d6b13ac35644f (patch)
tree33bf7a0758eeecfc5dd23a9384ca842018c21e75
parent8ee818df9b7f0527bbd6596c56eac04e144889fe (diff)
downloadifuse-8d6eebb99d23ffb139b311b60d6d6b13ac35644f.tar.gz
ifuse-8d6eebb99d23ffb139b311b60d6d6b13ac35644f.tar.bz2
Fixes truncate method using new libiphone
Signed-off-by: Matt Colyer <matt@colyer.name>
-rw-r--r--src/ifuse.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/ifuse.c b/src/ifuse.c
index 1ec1569..f2acc78 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -222,9 +222,9 @@ int ifuse_statfs(const char *path, struct statvfs *stats)
for (i = 0; info_raw[i]; i++) {
if (!strcmp(info_raw[i], "FSTotalBytes")) {
- totalspace = strtoull(info_raw[i + 1], (char **)NULL, 10);
+ totalspace = strtoull(info_raw[i + 1], (char **) NULL, 10);
} else if (!strcmp(info_raw[i], "FSFreeBytes")) {
- freespace = strtoull(info_raw[i + 1], (char **)NULL, 10);
+ freespace = strtoull(info_raw[i + 1], (char **) NULL, 10);
} else if (!strcmp(info_raw[i], "FSBlockSize")) {
blocksize = atoi(info_raw[i + 1]);
}
@@ -242,16 +242,8 @@ int ifuse_statfs(const char *path, struct statvfs *stats)
int ifuse_truncate(const char *path, off_t size)
{
- int result = 0;
iphone_afc_client_t afc = fuse_get_context()->private_data;
- iphone_afc_file_t tfile = NULL;
- iphone_afc_open_file(afc, path, IPHONE_AFC_FILE_READ, &tfile);
- if (!tfile)
- return -1;
-
- result = iphone_afc_truncate_file(afc, tfile, size);
- iphone_afc_close_file(afc, tfile);
- return result;
+ return iphone_afc_truncate(afc, path, size);
}
int ifuse_ftruncate(const char *path, off_t size, struct fuse_file_info *fi)