2001-06-22 13:22:26 -04:00
|
|
|
/*
|
2015-05-23 08:21:51 -04:00
|
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2001-06-22 13:22:26 -04:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
2021-06-03 02:37:05 -04:00
|
|
|
*
|
2001-06-22 13:22:26 -04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 03:53:12 -05:00
|
|
|
*
|
2001-06-22 13:22:26 -04:00
|
|
|
* See the COPYRIGHT file distributed with this work for additional
|
|
|
|
|
* information regarding copyright ownership.
|
|
|
|
|
*/
|
|
|
|
|
|
2005-04-27 00:57:32 -04:00
|
|
|
/*! \file */
|
2001-06-22 13:22:26 -04:00
|
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
|
#include <stdarg.h>
|
2018-04-17 11:29:14 -04:00
|
|
|
#include <stdbool.h>
|
2001-06-22 13:22:26 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
2024-02-07 08:44:39 -05:00
|
|
|
#include <unistd.h>
|
2001-06-22 13:22:26 -04:00
|
|
|
|
2023-01-27 00:52:59 -05:00
|
|
|
#include <isc/tls.h>
|
|
|
|
|
|
2018-04-17 11:29:14 -04:00
|
|
|
extern bool verbose;
|
2001-06-22 13:22:26 -04:00
|
|
|
extern const char *progname;
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
notify(const char *fmt, ...) {
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
if (verbose) {
|
|
|
|
|
va_start(ap, fmt);
|
|
|
|
|
vfprintf(stderr, fmt, ap);
|
|
|
|
|
va_end(ap);
|
2020-04-02 21:51:06 -04:00
|
|
|
fprintf(stderr, "\n");
|
2001-06-22 13:22:26 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
fatal(const char *format, ...) {
|
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
|
|
fprintf(stderr, "%s: ", progname);
|
|
|
|
|
va_start(args, format);
|
|
|
|
|
vfprintf(stderr, format, args);
|
|
|
|
|
va_end(args);
|
|
|
|
|
fprintf(stderr, "\n");
|
2024-02-07 08:44:39 -05:00
|
|
|
_exit(EXIT_FAILURE);
|
2001-06-22 13:22:26 -04:00
|
|
|
}
|