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:
@@ -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
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user