gbranden pushed a commit to branch master
in repository groff.

commit f9697a36514be9a3f24ef9f6d861fd6b5a9ca5f5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Jan 2 07:11:40 2025 -0600

    [tbl]: Distinguish error scenarios.
    
    * src/preproc/tbl/main.cpp (main): Distinguish `ferror()` status and
      `fflush(stdout)` failures when cleaning up before exit.
---
 ChangeLog                | 5 +++++
 src/preproc/tbl/main.cpp | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5025b77cc..96a26b0b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-01-02  G. Branden Robinson <[email protected]>
+
+       * src/preproc/tbl/main.cpp (main): Distinguish `ferror()` status
+       and `fflush(stdout)` failures when cleaning up before exit.
+
 2024-12-24  Collin Funk  <[email protected]>
 
        Use the `strcase` Gnulib module.
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index ba42be809..4b1dbe961 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2025 Free Software Foundation, Inc.
      Written by James Clark ([email protected])
 
 This file is part of groff.
@@ -1727,8 +1727,10 @@ int main(int argc, char **argv)
     printf(".lf 1 -\n");
     process_input_file(stdin);
   }
-  if (ferror(stdout) || fflush(stdout) < 0)
-    fatal("output error");
+  if (ferror(stdout))
+    fatal("error status on standard output stream");
+  if (fflush(stdout) < 0)
+    fatal("cannot flush standard output stream: %1", strerror(errno));
   return 0;
 }
 

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to