File: error.c

package info (click to toggle)
recoverdm 0.20-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 252 kB
  • sloc: ansic: 2,503; makefile: 45; sh: 14
file content (21 lines) | stat: -rw-r--r-- 342 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <signal.h>

void error_exit(char *format, ...)
{
	va_list ap;

	fflush(NULL);

	va_start(ap, format);
	(void)vfprintf(stderr, format, ap);
	va_end(ap);
	fprintf(stderr, "errno=%d (if applicable)\n", errno);

	exit(EXIT_FAILURE);
}