]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elfclassify: Handle fwrite to stdout failing.
authorMark Wielaard <mark@klomp.org>
Sun, 19 Jul 2020 17:36:38 +0000 (19:36 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 23 Jul 2020 15:24:17 +0000 (17:24 +0200)
In theory an fwrite can fail, if so, signal it by calling issue ().

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/elfclassify.c

index f65246f11e06c6ea4ec732d7c22ec44f30da92af..2452cd400cafa0be6b74db0f0ede803efb6cec89 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-19  Mark Wielaard  <mark@klomp.org>
+
+       * elfclassify.c (process_current_path): Handle fwrite failing.
+
 2020-07-05  Mark Wielaard  <mark@klomp.org>
 
        * stack.c (module_callback): Don't assert if dwfl_module_info fails.
index 535cc49fcaa0f7578b174bf7a2b1efa7aa58b864..624bb86164a1ae864f91ddbf33c57be016a44dd2 100644 (file)
@@ -827,7 +827,8 @@ process_current_path (int *status)
       break;
     case do_print0:
       if (checks_passed == flag_print_matching)
-        fwrite (current_path, strlen (current_path) + 1, 1, stdout);
+        if (fwrite (current_path, strlen (current_path) + 1, 1, stdout) < 1)
+         issue (errno, N_("writing to standard output"));
       break;
     case no_print:
       if (!checks_passed)