If there is an I/O error on stdout, return a non-zero status so that udev can avoid trusting the values printed. Deeper changes to the log code are out of scope for this patch. --- libdm/dm-tools/dmsetup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c index d01b8f2..0449e40 100644 --- a/libdm/dm-tools/dmsetup.c +++ b/libdm/dm-tools/dmsetup.c @@ -7491,5 +7491,7 @@ out: if (_initial_timestamp) dm_timestamp_destroy(_initial_timestamp); + if (fflush(stdout) || ferror(stdout)) + return 1; return (_switches[HELP_ARG] || _switches[VERSION_ARG]) ? 0 : ret; } -- Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab