diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-08 17:54:47 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-08 17:54:47 +0000 |
commit | 7039a66b58706457c7423de60556e04545432943 (patch) | |
tree | a512daebc3674c819766664c8ea17d41ef7fef02 /libbb | |
parent | 1385899416a4396385ad421ae1f532be7103738a (diff) | |
download | busybox-7039a66b58706457c7423de60556e04545432943.tar.gz |
correct largefile support, add comments about it.
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/copyfd.c | 10 | ||||
-rw-r--r-- | libbb/loop.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c index e9300a97d..87126eb72 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c @@ -21,10 +21,10 @@ #endif -static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size) +static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) { int status = -1; - size_t total = 0; + off_t total = 0; RESERVE_CONFIG_BUFFER(buffer,BUFSIZ); if (src_fd < 0) goto out; @@ -56,11 +56,11 @@ static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size) out: RELEASE_CONFIG_BUFFER(buffer); - return status ? status : (ssize_t)total; + return status ? status : total; } -int bb_copyfd_size(int fd1, int fd2, const off_t size) +off_t bb_copyfd_size(int fd1, int fd2, off_t size) { if (size) { return bb_full_fd_action(fd1, fd2, size); @@ -68,7 +68,7 @@ int bb_copyfd_size(int fd1, int fd2, const off_t size) return 0; } -int bb_copyfd_eof(int fd1, int fd2) +off_t bb_copyfd_eof(int fd1, int fd2) { return bb_full_fd_action(fd1, fd2, 0); } diff --git a/libbb/loop.c b/libbb/loop.c index 1b296d99b..14835ec24 100644 --- a/libbb/loop.c +++ b/libbb/loop.c @@ -133,7 +133,9 @@ int set_loop(char **device, const char *file, unsigned long long offset) without using losetup manually is problematic.) */ } else if (strcmp(file,(char *)loopinfo.lo_file_name) - || offset!=loopinfo.lo_offset) rc = -1; + || offset != loopinfo.lo_offset) { + rc = -1; + } close(dfd); try_again: if (*device) break; |