1 /* Fatal exits for noninteractive utilities
3 Copyright (C) 2001, 2003 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
32 # define program_name program_invocation_name
34 /* The calling program should define program_name and set it to the
35 name of the executing program. */
36 extern char *program_name;
39 #include "unlocked-io.h"
41 /* Like error, but always exit with EXIT_FAILURE. */
44 fatal (int errnum, const char *message, ...)
48 if (error_print_progname)
49 (*error_print_progname) ();
53 fprintf (stderr, "%s: ", program_name);
56 va_start (args, message);
57 error (EXIT_FAILURE, errnum, message, args);
59 /* The following code isn't reachable, but pacifies some compilers. */