exit.c 1.1 KB

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