// Copy all data from fd_in to fd_out.
bool
-copy_fd(int fd_in, int fd_out, bool fd_in_is_file)
+copy_fd(int fd_in, int fd_out)
{
ssize_t n;
char buf[READ_BUFFER_SIZE];
if (!write_fd(fd_out, buf, n)) {
return false;
}
-
- if (fd_in_is_file && static_cast<size_t>(n) < sizeof(buf)) {
- break;
- }
}
return true;
}
}
- if (copy_fd(*src_fd, *dest_fd, true)) {
+ if (copy_fd(*src_fd, *dest_fd)) {
result = true;
}
void fatal(const char* format, ...) ATTR_FORMAT(printf, 1, 2) ATTR_NORETURN;
bool write_fd(int fd, const void* buf, size_t size);
-bool copy_fd(int fd_in, int fd_out, bool fd_in_is_file = false);
+bool copy_fd(int fd_in, int fd_out);
bool clone_file(const char* src, const char* dest, bool via_tmp_file);
bool copy_file(const char* src, const char* dest, bool via_tmp_file);
bool move_file(const char* src, const char* dest);