]> 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>
Wed, 23 Apr 2014 09:55:08 +0000 (11:55 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index 3ed0b1db7576d33a86139954f6696f7fb7a1c998..1775771521edc5eebf573a42d5a4046fbbcf6028 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);
+               }
        }
 }