| 8 | #include "abspath.h" |
| 9 | |
| 10 | int copy_fd(int ifd, int ofd) |
| 11 | { |
| 12 | while (1) { |
| 13 | char buffer[8192]; |
| 14 | ssize_t len = xread(ifd, buffer, sizeof(buffer)); |
| 15 | if (!len) |
| 16 | break; |
| 17 | if (len < 0) |
| 18 | return COPY_READ_ERROR; |
| 19 | if (write_in_full(ofd, buffer, len) < 0) |
| 20 | return COPY_WRITE_ERROR; |
| 21 | } |
| 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | static int copy_times(const char *dst, const char *src) |
| 26 | { |
no test coverage detected