Set the exit status to 8 when /dev/null is not usable and --discard is active (#192).

This commit is contained in:
Andrew Wood
2026-05-04 16:30:34 +01:00
parent a4b90879a0
commit 547efed258
+2
View File
@@ -541,10 +541,12 @@ int pv_next_file(pvstate_t state, unsigned int filenum, int oldfd)
pv_perror("%s", "/dev/null");
(void) close(fd);
fd = -1;
state->status.exit_status |= PV_ERROREXIT_TRANSITION;
}
if (!pv_fd_is_dev_null(state->transfer.discard_fd, true)) {
(void) close(fd);
fd = -1;
state->status.exit_status |= PV_ERROREXIT_TRANSITION;
}
}
#endif /* HAVE_SPLICE */