]> git.cworth.org Git - tar/blob - src/exit.c
Imported Upstream version 1.24
[tar] / src / exit.c
1 /* This file is part of GNU tar.
2    Copyright (C) 2009 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or modify it
5    under the terms of the GNU General Public License as published by the
6    Free Software Foundation; either version 3, or (at your option) any later
7    version.
8
9    This program is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
12    Public License for more details.
13
14    You should have received a copy of the GNU General Public License along
15    with this program; if not, write to the Free Software Foundation, Inc.,
16    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17
18 #include <system.h>
19 #include "common.h"
20
21 void (*fatal_exit_hook) (void);
22
23 void
24 fatal_exit (void)
25 {
26   if (fatal_exit_hook)
27     fatal_exit_hook ();
28   error (TAREXIT_FAILURE, 0, _("Error is not recoverable: exiting now"));
29   abort ();
30 }
31
32 void
33 xalloc_die (void)
34 {
35   error (0, 0, "%s", _("memory exhausted"));
36   fatal_exit ();
37 }