diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-08 17:54:47 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-08 17:54:47 +0000 |
commit | 8923a8c94c288f5dba133a439f35666b5de2aac4 (patch) | |
tree | a512daebc3674c819766664c8ea17d41ef7fef02 /libbb | |
parent | 87d25a2b8535dc627a02eb539fa3946be2a24647 (diff) | |
download | busybox-w32-8923a8c94c288f5dba133a439f35666b5de2aac4.tar.gz busybox-w32-8923a8c94c288f5dba133a439f35666b5de2aac4.tar.bz2 busybox-w32-8923a8c94c288f5dba133a439f35666b5de2aac4.zip |
correct largefile support, add comments about it.
git-svn-id: svn://busybox.net/trunk/busybox@16343 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 @@ | |||
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | 23 | ||
24 | static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size) | 24 | static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) |
25 | { | 25 | { |
26 | int status = -1; | 26 | int status = -1; |
27 | size_t total = 0; | 27 | off_t total = 0; |
28 | RESERVE_CONFIG_BUFFER(buffer,BUFSIZ); | 28 | RESERVE_CONFIG_BUFFER(buffer,BUFSIZ); |
29 | 29 | ||
30 | if (src_fd < 0) goto out; | 30 | 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) | |||
56 | out: | 56 | out: |
57 | RELEASE_CONFIG_BUFFER(buffer); | 57 | RELEASE_CONFIG_BUFFER(buffer); |
58 | 58 | ||
59 | return status ? status : (ssize_t)total; | 59 | return status ? status : total; |
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
63 | int bb_copyfd_size(int fd1, int fd2, const off_t size) | 63 | off_t bb_copyfd_size(int fd1, int fd2, off_t size) |
64 | { | 64 | { |
65 | if (size) { | 65 | if (size) { |
66 | return bb_full_fd_action(fd1, fd2, size); | 66 | return bb_full_fd_action(fd1, fd2, size); |
@@ -68,7 +68,7 @@ int bb_copyfd_size(int fd1, int fd2, const off_t size) | |||
68 | return 0; | 68 | return 0; |
69 | } | 69 | } |
70 | 70 | ||
71 | int bb_copyfd_eof(int fd1, int fd2) | 71 | off_t bb_copyfd_eof(int fd1, int fd2) |
72 | { | 72 | { |
73 | return bb_full_fd_action(fd1, fd2, 0); | 73 | return bb_full_fd_action(fd1, fd2, 0); |
74 | } | 74 | } |
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) | |||
133 | without using losetup manually is problematic.) | 133 | without using losetup manually is problematic.) |
134 | */ | 134 | */ |
135 | } else if (strcmp(file,(char *)loopinfo.lo_file_name) | 135 | } else if (strcmp(file,(char *)loopinfo.lo_file_name) |
136 | || offset!=loopinfo.lo_offset) rc = -1; | 136 | || offset != loopinfo.lo_offset) { |
137 | rc = -1; | ||
138 | } | ||
137 | close(dfd); | 139 | close(dfd); |
138 | try_again: | 140 | try_again: |
139 | if (*device) break; | 141 | if (*device) break; |