From 547efed2588c0e6b9c6d4c53be95b74a99039e12 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Mon, 4 May 2026 16:30:34 +0100 Subject: [PATCH] Set the exit status to 8 when /dev/null is not usable and --discard is active (#192). --- src/pv/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pv/file.c b/src/pv/file.c index 6451d44..d6f8615 100644 --- a/src/pv/file.c +++ b/src/pv/file.c @@ -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 */