Debian Codegraph @

lib/fatal.c

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