diff options
author | Kenny Root <kroot@google.com> | 2011-01-11 15:38:31 -0800 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2011-01-11 16:05:10 -0800 |
commit | 90749774edd0c0cab327b62ce43cb4dfd33e897d (patch) | |
tree | 3029a3282f5e562233c31ee3c4470a460ee78014 /sdcard/sdcard.c | |
parent | d66aa9162324ba263049d983e104756629c7af21 (diff) | |
download | core-90749774edd0c0cab327b62ce43cb4dfd33e897d.tar.gz core-90749774edd0c0cab327b62ce43cb4dfd33e897d.tar.bz2 core-90749774edd0c0cab327b62ce43cb4dfd33e897d.zip |
Use pread64/pwrite64 instead of pread/pwrite
>2GB files were failing strangely when pread was used instead of
pread64. Also writing to files should use pwrite64 in case they grow
over 2GB.
Bug: 3205336
Change-Id: I0c9619de35680093d7777ca132ce488eae502216
Diffstat (limited to 'sdcard/sdcard.c')
-rw-r--r-- | sdcard/sdcard.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c index 9dda0ea37..86d7693f2 100644 --- a/sdcard/sdcard.c +++ b/sdcard/sdcard.c @@ -652,7 +652,7 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_in_header *hdr, void *da fuse_status(fuse, hdr->unique, -EINVAL); return; } - res = pread(h->fd, buffer, req->size, req->offset); + res = pread64(h->fd, buffer, req->size, req->offset); if (res < 0) { fuse_status(fuse, hdr->unique, errno); return; @@ -666,7 +666,7 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_in_header *hdr, void *da struct handle *h = id_to_ptr(req->fh); int res; TRACE("WRITE %p(%d) %u@%llu\n", h, h->fd, req->size, req->offset); - res = pwrite(h->fd, ((char*) data) + sizeof(*req), 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); return; |