| 1548 | } |
| 1549 | |
| 1550 | OFF_T get_device_size(int fd, const char *fname) |
| 1551 | { |
| 1552 | OFF_T off = lseek(fd, 0, SEEK_END); |
| 1553 | |
| 1554 | if (off == (OFF_T) -1) { |
| 1555 | rsyserr(FERROR, errno, "failed to get device size via seek: %s", fname); |
| 1556 | return 0; |
| 1557 | } |
| 1558 | if (lseek(fd, 0, SEEK_SET) != 0) |
| 1559 | rsyserr(FERROR, errno, "failed to seek device back to start: %s", fname); |
| 1560 | |
| 1561 | return off; |
| 1562 | } |
| 1563 | |
| 1564 | /* Only called for temporary file_struct entries created by make_file(). */ |
| 1565 | void unmake_file(struct file_struct *file) |
no test coverage detected