git: cb46f47c7969 - main - tsort: Error out if writing to stdout failed.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 04 May 2023 18:52:52 UTC
The branch main has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=cb46f47c7969b619d1b2547d06a75ad5b375eda9
commit cb46f47c7969b619d1b2547d06a75ad5b375eda9
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-05-04 17:26:59 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-05-04 18:51:11 +0000
tsort: Error out if writing to stdout failed.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D39959
---
usr.bin/tsort/tsort.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c
index 58492b26999c..b2dbe9beb799 100644
--- a/usr.bin/tsort/tsort.c
+++ b/usr.bin/tsort/tsort.c
@@ -183,6 +183,8 @@ main(int argc, char *argv[])
/* do the sort */
tsort();
+ if (ferror(stdout) != 0 || fflush(stdout) != 0)
+ err(1, "stdout");
exit(0);
}