aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/copyfd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 9ab83728c..00115e2c9 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -50,8 +50,8 @@ static size_t bb_full_fd_action(int src_fd, int dst_fd, const size_t size)
50 } 50 }
51 51
52 read_actual = safe_read(src_fd, buffer, read_try); 52 read_actual = safe_read(src_fd, buffer, read_try);
53 if ((read_actual > 0) && (dst_fd >= 0)) { 53 if (read_actual > 0) {
54 if (bb_full_write(dst_fd, buffer, (size_t) read_actual) != read_actual) { 54 if ((dst_fd >= 0) && (bb_full_write(dst_fd, buffer, (size_t) read_actual) != read_actual)) {
55 bb_perror_msg(bb_msg_write_error); /* match Read error below */ 55 bb_perror_msg(bb_msg_write_error); /* match Read error below */
56 break; 56 break;
57 } 57 }