/************************************************************************* * Copyright (C) Michael Kerrisk, 2014. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU Lesser General Public License as published * * by the Free Software Foundation, either version 3 or (at your option) * * any later version. This program is distributed without any warranty. * * See the files COPYING.lgpl-v3 and COPYING.gpl-v3 for details. * *************************************************************************/ /* error_functions.c Some standard error handling routines used by various programs. */ #include <stdarg.h> #include "error_functions.h" #include "tlpi_hdr.h" #include "ename.c.inc" /* Defines ename and MAX_ENAME */ #ifdef __GNUC__ /* Prevent 'gcc -Wall' complaining */ __attribute__ ((__noreturn__)) /* if we call this function as last */ #endif /* statement in a non-void function */ static void terminate(Boolean useExit3) { char *s; /* Dump core if EF_DUMPCORE environment variable is defined and is a nonempty string; otherwise call exit(3) or _exit(2), depending on the value of 'useExit3'. */ s = getenv("EF_DUMPCORE"); if (s != NULL && *s != '