]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: don't report EPIPE
authorKarel Zak <kzak@redhat.com>
Thu, 13 Mar 2014 11:39:09 +0000 (12:39 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 13 Mar 2014 11:39:09 +0000 (12:39 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index c1f84a5688760149e34522d843fb5f910a2952aa..df68c8440442fe231d83772da3f7499f5057175b 100644 (file)
@@ -639,8 +639,11 @@ static void safe_fwrite(const char *buf, size_t size, FILE *out)
                        rc = fwrite_hex(p, len, out);
                else
                        rc = fwrite(p, 1, len, out) != len;
-               if (rc != 0)
-                       err(EXIT_FAILURE, _("write failed"));
+               if (rc != 0) {
+                       if (errno != EPIPE)
+                               err(EXIT_FAILURE, _("write failed"));
+                       exit(EXIT_SUCCESS);
+               }
        }
 }