summaryrefslogtreecommitdiffstats
path: root/sdcard/sdcard.c
diff options
context:
space:
mode:
Diffstat (limited to 'sdcard/sdcard.c')
-rw-r--r--sdcard/sdcard.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index 7112ebf..689cd2a 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -326,15 +326,9 @@ void fuse_init(struct fuse *fuse, int fd, const char *path)
fuse->all = &fuse->root;
+ memset(&fuse->root, 0, sizeof(fuse->root));
fuse->root.nid = FUSE_ROOT_ID; /* 1 */
- fuse->root.next = 0;
- fuse->root.child = 0;
- fuse->root.parent = 0;
-
- fuse->root.all = 0;
fuse->root.refcount = 2;
-
- fuse->root.name = 0;
rename_node(&fuse->root, path);
}
@@ -762,7 +756,7 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_in_header *hdr, void *da
h->fd = open(path, req->flags);
if (h->fd < 0) {
ERROR("ERROR\n");
- fuse_status(fuse, hdr->unique, errno);
+ fuse_status(fuse, hdr->unique, -errno);
free(h);
return;
}
@@ -784,7 +778,7 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_in_header *hdr, void *da
}
res = pread64(h->fd, buffer, req->size, req->offset);
if (res < 0) {
- fuse_status(fuse, hdr->unique, errno);
+ fuse_status(fuse, hdr->unique, -errno);
return;
}
fuse_reply(fuse, hdr->unique, buffer, res);
@@ -798,7 +792,7 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_in_header *hdr, void *da
TRACE("WRITE %p(%d) %u@%llu\n", h, h->fd, req->size, req->offset);
res = pwrite64(h->fd, ((char*) data) + sizeof(*req), req->size, req->offset);
if (res < 0) {
- fuse_status(fuse, hdr->unique, errno);
+ fuse_status(fuse, hdr->unique, -errno);
return;
}
out.size = res;