diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2003-06-18 12:57:43 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2003-06-18 12:57:43 +0000 |
commit | f82e2b21e89539c1892dc0a9855e33e931f1d5f7 (patch) | |
tree | 17923f3c3c11ccba32be7fb4eaa72821a948a5b5 /contrib/texinfo/lib/xexit.c | |
parent | 0eecaa8d986544d50ed18ae39db68c0f4796d09c (diff) | |
parent | c332585b532ef1a520b001560e17be60f927e08d (diff) |
This commit was generated by cvs2svn to compensate for changes in r116525,
which included commits to RCS files with non-trunk default branches.
Notes
Notes:
svn path=/head/; revision=116526
Diffstat (limited to 'contrib/texinfo/lib/xexit.c')
-rw-r--r-- | contrib/texinfo/lib/xexit.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/contrib/texinfo/lib/xexit.c b/contrib/texinfo/lib/xexit.c index fafe4b382975..fa783b3eb9e7 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); } |