aboutsummaryrefslogtreecommitdiff
path: root/libbb/copyfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/copyfd.c')
-rw-r--r--libbb/copyfd.c10
1 files changed, 5 insertions, 5 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
24static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size) 24static 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)
56out: 56out:
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
63int bb_copyfd_size(int fd1, int fd2, const off_t size) 63off_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
71int bb_copyfd_eof(int fd1, int fd2) 71off_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}