aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/copyfd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 0c4f7a054..e9300a97d 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -28,8 +28,7 @@ static ssize_t bb_full_fd_action(int src_fd, int dst_fd, size_t size)
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;
31 while (!size || total < size) 31 while (!size || total < size) {
32 {
33 ssize_t wr, rd; 32 ssize_t wr, rd;
34 33
35 rd = safe_read(src_fd, buffer, 34 rd = safe_read(src_fd, buffer,
@@ -64,12 +63,12 @@ out:
64int bb_copyfd_size(int fd1, int fd2, const off_t size) 63int bb_copyfd_size(int fd1, int fd2, const off_t size)
65{ 64{
66 if (size) { 65 if (size) {
67 return(bb_full_fd_action(fd1, fd2, size)); 66 return bb_full_fd_action(fd1, fd2, size);
68 } 67 }
69 return(0); 68 return 0;
70} 69}
71 70
72int bb_copyfd_eof(int fd1, int fd2) 71int bb_copyfd_eof(int fd1, int fd2)
73{ 72{
74 return(bb_full_fd_action(fd1, fd2, 0)); 73 return bb_full_fd_action(fd1, fd2, 0);
75} 74}