(root)/
man-db-2.12.0/
lib/
fatal.c
       1  /*
       2   * fatal.c: fatal error helper
       3   *
       4   * Copyright (C) 2022 Colin Watson.
       5   *
       6   * This file is part of man-db.
       7   *
       8   * man-db is free software; you can redistribute it and/or modify it
       9   * under the terms of the GNU General Public License as published by
      10   * the Free Software Foundation; either version 2 of the License, or
      11   * (at your option) any later version.
      12   *
      13   * man-db is distributed in the hope that it will be useful, but
      14   * WITHOUT ANY WARRANTY; without even the implied warranty of
      15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16   * GNU General Public License for more details.
      17   *
      18   * You should have received a copy of the GNU General Public License
      19   * along with man-db; if not, write to the Free Software Foundation,
      20   * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
      21   */
      22  
      23  #ifdef HAVE_CONFIG_H
      24  #  include "config.h"
      25  #endif /* HAVE_CONFIG_H */
      26  
      27  #include <stdarg.h>
      28  #include <stdlib.h>
      29  
      30  #include "verror.h"
      31  
      32  #include "manconfig.h"
      33  
      34  #include "fatal.h"
      35  
      36  void fatal (int errnum, const char *format, ...)
      37  {
      38  	va_list ap;
      39  
      40  	va_start (ap, format);
      41  	verror (FATAL, errnum, format, ap);
      42  	va_end (ap);
      43  
      44  	/* Never reached, because verror exits if given a non-zero status,
      45  	 * but the compiler may not be able to prove that.
      46  	 */
      47  	abort ();
      48  }