From: Paul Eggert Date: Tue, 1 Jul 2025 18:53:33 +0000 (-0700) Subject: factor: no ferror+fclose X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb20a7d3e47dac222efaecc2837610e61349a8fe;p=thirdparty%2Fcoreutils.git factor: no ferror+fclose * src/make-prime-list.c (main): Avoid parallel calls to ferror and fclose. --- diff --git a/src/make-prime-list.c b/src/make-prime-list.c index 2fd10f760c..fbeac1736e 100644 --- a/src/make-prime-list.c +++ b/src/make-prime-list.c @@ -234,7 +234,7 @@ main (int argc, char **argv) free (sieve); free (prime_list); - if (ferror (stdout) + fclose (stdout)) + if (ferror (stdout) || fclose (stdout)) { fprintf (stderr, "write error: %s\n", strerror (errno)); return EXIT_FAILURE;