Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2023 18:52:52 GMT
From:      =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: cb46f47c7969 - main - tsort: Error out if writing to stdout failed.
Message-ID:  <202305041852.344Iqq12082028@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305041852.344Iqq12082028>