Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2023 18:52:51 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: 5903d9c00b75 - main - ncal: Error out if writing to stdout failed.
Message-ID:  <202305041852.344IqpV7082004@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=5903d9c00b75f17f09404d1001ee5aaae7603a61

commit 5903d9c00b75f17f09404d1001ee5aaae7603a61
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-05-04 17:26:54 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-05-04 18:51:10 +0000

    ncal: 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/D39958
---
 usr.bin/ncal/ncal.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c
index 5a6c33ce759d..b4f025141f92 100644
--- a/usr.bin/ncal/ncal.c
+++ b/usr.bin/ncal/ncal.c
@@ -497,6 +497,8 @@ main(int argc, char *argv[])
 			monthrangeb(y, m, flag_julian_day, before, after);
 		else
 			monthranger(y, m, flag_julian_day, before, after);
+	if (ferror(stdout) != 0 || fflush(stdout) != 0)
+		err(1, "stdout");
 	return (0);
 }
 



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