1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-25 18:19:00 +02:00

Always call error with errno (not zero) after failed fclose or non-zero ferror.

This commit is contained in:
Jim Meyering
1993-03-30 03:32:10 +00:00
parent 86a2a3f5f6
commit 56b1029ccf
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -233,7 +233,7 @@ main (argc, argv)
exit_status = 1;
}
if (ferror (stdout) || fclose (stdout) == EOF)
error (1, 0, "write error");
error (1, errno, "write error");
exit (exit_status);
}
+1 -1
View File
@@ -162,7 +162,7 @@ main (argc, argv)
if (have_read_stdin && fclose (stdin) == EOF)
error (1, errno, "-");
if (ferror (stdout) || fclose (stdout) == EOF)
error (1, 0, "write error");
error (1, errno, "write error");
exit (exit_status);
}
+1 -1
View File
@@ -664,7 +664,7 @@ main (argc, argv)
if ((fp1 == stdin || fp2 == stdin) && fclose (stdin) == EOF)
error (1, errno, "-");
if (ferror (stdout) || fclose (stdout) == EOF)
error (1, 0, "write error");
error (1, errno, "write error");
exit (0);
}
+1 -1
View File
@@ -293,7 +293,7 @@ main (argc, argv)
exit_status = 1;
}
if (ferror (stdout) || fclose (stdout) == EOF)
error (1, 0, "write error");
error (1, errno, "write error");
exit (exit_status);
}
+1 -1
View File
@@ -1727,7 +1727,7 @@ main (argc, argv)
if (have_read_stdin && fclose (stdin) == EOF)
error (1, errno, "-");
if (ferror (stdout) || fclose (stdout) == EOF)
error (1, 0, "write error");
error (1, errno, "write error");
exit (0);
}