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
This commit is contained in:
Dag-Erling Smørgrav 2023-05-04 17:26:59 +00:00
parent 5903d9c00b
commit cb46f47c79

View File

@ -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);
}