Exemplo n.º 1
0
static
void __error(void *_, const char *file, int line, const char *fmt, ...) {
  CASLIB_UNUSED(_);
  va_list args;
  va_start(args, fmt);
  fprintf(stderr, "error ");
  __dolog(file, line, fmt, args);
  va_end(args);
}
Exemplo n.º 2
0
void dolog(const char *str, ...)
{
	va_list va;
	char *buff;

	va_start(va, str);
	(void) vasprintf(&buff, str, va);
	va_end(va);

	__dolog(_("%s: %s"), prog, buff);
	free(buff);
}
Exemplo n.º 3
0
void __noreturn error_nret(const char *str, ...)
{
	va_list ap;
	char *buff;

	va_start(ap, str);
	vasprintf(&buff, str, ap);
	va_end(ap);

	__dolog(_("%s: %s\n%s: error is not recoverable, terminating now...\n"),
	        prog, buff, prog);
	free(buff);
	exit(EXIT_FAILURE);
}