summaryrefslogtreecommitdiffstats
path: root/contrib/texinfo/lib/xexit.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-06-18 12:57:43 +0000
committerru <ru@FreeBSD.org>2003-06-18 12:57:43 +0000
commitb0465e4534c37946b9f157053a91a25b88ee6c6f (patch)
tree92a83a9292c9ea3b8a8e235e830bf6581591579e /contrib/texinfo/lib/xexit.c
parent1e2af4f2c82dd1396d247a2b5fe032b13c51189a (diff)
downloadFreeBSD-src-b0465e4534c37946b9f157053a91a25b88ee6c6f.zip
FreeBSD-src-b0465e4534c37946b9f157053a91a25b88ee6c6f.tar.gz
Import of stripped down GNU texinfo 4.6
Diffstat (limited to 'contrib/texinfo/lib/xexit.c')
-rw-r--r--contrib/texinfo/lib/xexit.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/contrib/texinfo/lib/xexit.c b/contrib/texinfo/lib/xexit.c
index fafe4b3..fa783b3 100644
--- a/contrib/texinfo/lib/xexit.c
+++ b/contrib/texinfo/lib/xexit.c
@@ -1,7 +1,7 @@
/* xexit.c -- exit with attention to return values and closing stdout.
- $Id: xexit.c,v 1.1 2002/08/25 23:38:38 karl Exp $
+ $Id: xexit.c,v 1.4 2003/05/19 13:10:59 karl Exp $
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,26 +41,28 @@
#endif /* not EXIT_SUCCESS */
-/* Flush stdout first, exit if failure. Otherwise, if EXIT_STATUS is
- zero, exit successfully, else unsuccessfully. */
-
+/* Flush stdout first, exit if failure (therefore, xexit should be
+ called to exit every program, not just `return' from main).
+ Otherwise, if EXIT_STATUS is zero, exit successfully, else
+ unsuccessfully. */
+
void
xexit (exit_status)
int exit_status;
{
if (ferror (stdout))
{
- fprintf (stderr, "ferror on stdout");
+ fputs (_("ferror on stdout\n"), stderr);
exit_status = 1;
}
else if (fflush (stdout) != 0)
{
- fprintf (stderr, "fflush error on stdout");
+ fputs (_("fflush error on stdout\n"), stderr);
exit_status = 1;
}
-
+
exit_status = exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
-
+
exit (exit_status);
}
OpenPOWER on IntegriCloud