"usage: %s [-chijlvz] [-p [-x]] [-t directory] "
"[named.conf]\n",
program);
- exit(1);
+ exit(EXIT_SUCCESS);
}
/*% directory callback */
UNUSED(closure);
if (fwrite(text, 1, textlen, stdout) != (size_t)textlen) {
perror("fwrite");
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chroot: %s\n",
isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'v':
printf("%s\n", PACKAGE_VERSION);
- exit(0);
+ exit(EXIT_SUCCESS);
case 'x':
flags |= CFG_PRINTER_XKEY;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (((flags & CFG_PRINTER_XKEY) != 0) && !print) {
fprintf(stderr, "%s: -x cannot be used without -p\n", program);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (print && list_zones) {
fprintf(stderr, "%s: -l cannot be used with -p\n", program);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (isc_commandline_index + 1 < argc) {
if (cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config) !=
ISC_R_SUCCESS)
{
- exit(1);
+ exit(EXIT_FAILURE);
}
result = bind9_check_namedconf(config, loadplugins, nodeprecate, logc,
case 'v':
printf("%s\n", PACKAGE_VERSION);
- exit(0);
+ exit(EXIT_SUCCESS);
case 'w':
workdir = isc_commandline_argument;
keyfile = isc_commandline_argument;
break;
case 'h':
- usage(0);
+ usage(EXIT_SUCCESS);
+ break;
case 'k':
case 'y': /* Compatible with rndc -y. */
keyname = isc_commandline_argument;
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
- usage(1);
+ usage(EXIT_FAILURE);
} else {
- usage(0);
+ usage(EXIT_SUCCESS);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
POST(argv);
if (argc > 0) {
- usage(1);
+ usage(EXIT_FAILURE);
}
if (alg == DST_ALG_HMACMD5) {
keysize = alg_bits(alg);
break;
case 'h':
- usage(0);
+ usage(EXIT_SUCCESS);
case 'k':
case 'y':
if (progmode == progmode_confgen) {
keyname = isc_commandline_argument;
} else {
- usage(1);
+ usage(EXIT_FAILURE);
}
break;
case 'M':
if (progmode == progmode_confgen) {
quiet = true;
} else {
- usage(1);
+ usage(EXIT_FAILURE);
}
break;
case 'r':
if (progmode == progmode_confgen) {
self_domain = isc_commandline_argument;
} else {
- usage(1);
+ usage(EXIT_FAILURE);
}
break;
case 'z':
if (progmode == progmode_confgen) {
zone = isc_commandline_argument;
} else {
- usage(1);
+ usage(EXIT_FAILURE);
}
break;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
- usage(1);
+ usage(EXIT_FAILURE);
} else {
- usage(0);
+ usage(EXIT_SUCCESS);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
POST(argv);
if (self_domain != NULL && zone != NULL) {
- usage(1); /* -s and -z cannot coexist */
+ usage(EXIT_FAILURE); /* -s and -z cannot coexist */
}
if (argc > isc_commandline_index) {
- usage(1);
+ usage(EXIT_FAILURE);
}
/* Use canonical algorithm name */
"process)\n"
" +[no]yaml (Present the results as "
"YAML)\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
noreturn static void
if (state) {
fprintf(stderr, "Invalid option: "
"+dlv is obsolete\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'n': /* dnssec */
break;
case 'h':
usage();
- exit(0);
+ exit(EXIT_SUCCESS);
case 'i':
no_sigs = true;
root_validation = false;
break;
case 'v':
fprintf(stderr, "delv %s\n", PACKAGE_VERSION);
- exit(0);
+ exit(EXIT_SUCCESS);
default:
UNREACHABLE();
}
typeset = true;
} else {
fprintf(stderr, "Invalid IP address %s\n", value);
- exit(1);
+ exit(EXIT_FAILURE);
}
return (value_from_next);
invalid_option:
print_usage(stderr);
fprintf(stderr, "\nUse \"dig -h\" (or \"dig -h | more\") "
"for complete list of options\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
#endif /* if TARGET_OS_IPHONE */
break;
case 'h':
help();
- exit(0);
+ exit(EXIT_SUCCESS);
break;
case 'i':
/* deprecated */
break;
case 'v':
version();
- exit(0);
+ exit(EXIT_SUCCESS);
break;
}
if (strlen(option) > 1U) {
ISC_LIST_APPEND(lookup_list, *lookup, link);
} else {
fprintf(stderr, "Invalid IP address %s\n", value);
- exit(1);
+ exit(EXIT_FAILURE);
}
return (value_from_next);
invalid_option:
" -W specifies how long to wait for a reply\n"
" -4 use IPv4 query transport only\n"
" -6 use IPv6 query transport only\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
static void
break;
case 'V':
version();
- exit(0);
+ exit(EXIT_SUCCESS);
break;
case 'w':
break;
"'host' using default server\n");
fprintf(stderr, " nslookup [-opt ...] host server # just look up "
"'host' using 'server'\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
static void
if (argv[0][0] == '-') {
if (strncasecmp(argv[0], "-ver", 4) == 0) {
version();
- exit(0);
+ exit(EXIT_SUCCESS);
} else if (argv[0][1] != 0) {
setoption(&argv[0][1]);
} else {
" -T <ttl> TTL of DS records\n"
" -V print version\n"
" -v <verbosity>\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
static void
cleanup:
print_mem_stats = true;
cleanup();
- exit(0);
+
+ return (0);
}
" -V: print version information\n");
fprintf(stderr, "Output: DS or CDS RRs\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
int
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
fprintf(stderr, " -D sync date/[+-]offset/none: set/unset "
"CDS and CDNSKEY deletion date\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
int
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
fprintf(stderr, " K<name>+<alg>+<id>.key, "
"K<name>+<alg>+<id>.private\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
int
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
fatal("failed to get key %s/%s: %s", namestr, algstr,
isc_result_totext(ret));
UNREACHABLE();
- exit(-1);
+ exit(EXIT_FAILURE);
}
/*
fprintf(stderr, " K<name>+<alg>+<id>.key, "
"K<name>+<alg>+<id>.private\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
static void
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
fprintf(stderr, " K<name>+<alg>+<new id>.key, "
"K<name>+<alg>+<new id>.private\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
int
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
fprintf(stderr, " K<name>+<alg>+<new id>.key, "
"K<name>+<alg>+<new id>.private\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
static void
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
fprintf(stderr, "(default: all zone keys that have private keys)\n");
fprintf(stderr, "\tkeyfile (Kname+alg+tag)\n");
- exit(0);
+ exit(EXIT_FAILURE);
}
static void
if (*endp != '\0') {
fprintf(stderr, "source serial number "
"must be numeric");
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
if (*endp != '\0') {
fprintf(stderr, "maximum TTL "
"must be numeric");
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
rawversion > 1U)
{
fprintf(stderr, "unknown raw format version\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
} else {
fatal("unknown file format: %s", outputformatstr);
fprintf(stderr, "\t-x:\tDNSKEY record signed with KSKs only, "
"not ZSKs\n");
fprintf(stderr, "\t-z:\tAll records signed with KSKs\n");
- exit(0);
+ exit(EXIT_SUCCESS);
}
int
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
void
version(const char *name) {
fprintf(stderr, "%s %s\n", name, PACKAGE_VERSION);
- exit(0);
+ exit(EXIT_SUCCESS);
}
void
printf("# Built-in default values. "
"This is NOT the run-time configuration!\n");
printf("%s", named_config_getdefault());
- exit(0);
+ exit(EXIT_SUCCESS);
case 'd':
named_g_debuglevel = parse_int(isc_commandline_argument,
"debug "
break;
case 'v':
printversion(false);
- exit(0);
+ exit(EXIT_SUCCESS);
case 'V':
printversion(true);
- exit(0);
+ exit(EXIT_SUCCESS);
case 'x':
/* Obsolete. No longer in use. Ignore. */
break;
case '?':
usage();
if (isc_commandline_option == '?') {
- exit(0);
+ exit(EXIT_SUCCESS);
}
p = strchr(NAMED_MAIN_ARGS, isc_commandline_option);
if (p == NULL || *++p != ':') {
char buf;
n = read(dfd[0], &buf, 1);
if (n == 1) {
- _exit(0);
+ _exit(EXIT_SUCCESS);
}
} while (n == -1 && errno == EINTR);
- _exit(1);
+ _exit(EXIT_FAILURE);
}
(void)close(dfd[0]);
#endif /* HAVE_LMDB */
#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t)-1)
+#define SIZE_MAX ((size_t) - 1)
#endif /* ifndef SIZE_MAX */
#ifndef SIZE_AS_PERCENT
-#define SIZE_AS_PERCENT ((size_t)-2)
+#define SIZE_AS_PERCENT ((size_t) - 2)
#endif /* ifndef SIZE_AS_PERCENT */
#ifdef TUNE_LARGE
NAMED_LOGMODULE_SERVER, ISC_LOG_CRITICAL,
"exiting (due to fatal error)");
named_os_shutdown();
- _exit(1);
+ _exit(EXIT_FAILURE);
}
static void
name = secretstr;
secretstr = n + 1;
if (!parse_hmac(&hmacname, keystr, s - keystr, &digestbits)) {
- exit(1);
+ exit(EXIT_FAILURE);
}
} else {
hmacname = DNS_TSIG_HMACMD5_NAME;
"| -k keyfile] [-p port] "
"[-v] [-V] [-P] [-T] [-4 | -6] "
"[filename]\n");
- exit(1);
+ exit(EXIT_FAILURE);
case 'P':
for (t = 0xff00; t <= 0xfffe; t++) {
}
}
if (doexit) {
- exit(0);
+ exit(EXIT_SUCCESS);
}
isc_commandline_reset = true;
isc_commandline_index = 1;
"bad library debug value "
"'%s'\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
logdebuglevel = i;
break;
"bad port number "
"'%s'\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 't':
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "bad timeout '%s'\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (timeout == 0) {
timeout = UINT_MAX;
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "bad udp timeout '%s'\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'r':
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "bad udp retries '%s'\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
default:
fprintf(stderr, "%s: unhandled option: %c\n", argv[0],
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (keyfile != NULL && keystr != NULL) {
fprintf(stderr, "%s: cannot specify both -k and -y\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
#if HAVE_GSSAPI
if (usegsstsig && (keyfile != NULL || keystr != NULL)) {
fprintf(stderr, "%s: cannot specify -g with -k or -y\n",
argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
#else /* HAVE_GSSAPI */
if (usegsstsig) {
"%s: cannot specify -g or -o, "
"program not linked with GSS API Library\n",
argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
#endif /* HAVE_GSSAPI */
fprintf(stderr, "could not open '%s': %s\n",
argv[isc_commandline_index],
isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (!force_interactive) {
if (bufsz > MAXTEXT) {
fprintf(stderr, "could not allocate large enough "
"buffer to display message\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
if (buf != NULL) {
isc_buffer_free(&buf);
if (seenerror) {
return (2);
- } else {
- return (0);
}
+
+ return (0);
}
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if ((x) != ISC_R_SUCCESS) { \
fprintf(stderr, "I:%s: %s\n", (str), \
isc_result_totext(x)); \
- exit(-1); \
+ exit(EXIT_FAILURE); \
} \
}
if (reqev->result != ISC_R_SUCCESS) {
fprintf(stderr, "I:request event result: %s\n",
isc_result_totext(reqev->result));
- exit(-1);
+ exit(EXIT_FAILURE);
}
query = reqev->ev_arg;
result = dns_result_fromrcode(response->rcode);
fprintf(stderr, "I:response rcode: %s\n",
isc_result_totext(result));
- exit(-1);
+ exit(EXIT_FAILURE);
}
if (response->counts[DNS_SECTION_ANSWER] != 1U) {
fprintf(stderr, "I:response answer count (%u!=1)\n",
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "bad port '%s'\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'r':
"[-S domain:serveraddr_for_domain ] [-s server_address]"
"[-b address[#port]] hostname\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
static void
result = dns_secalg_fromtext(&alg, &tr);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "failed to identify the algorithm\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
} else {
alg = DNS_KEYALG_RSASHA1;
result = isc_base64_decodestring(keystr, &keydatabuf);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "base64 decode failed\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
isc_buffer_usedregion(&keydatabuf, &r);
keystruct.datalen = r.length;
&rrdatabuf);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "failed to construct key rdata\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
namelen = strlen(keynamestr);
isc_buffer_init(&b, keynamestr, namelen);
result = dns_name_fromtext(keyname, &b, dns_rootname, 0, NULL);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "failed to construct key name\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
result = dns_client_addtrustedkey(client, dns_rdataclass_in,
dns_rdatatype_dnskey, keyname,
&rrdatabuf);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "failed to add key for %s\n", keynamestr);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (gaierror != 0) {
fprintf(stderr, "getaddrinfo failed: %s\n",
gai_strerror(gaierror));
- exit(1);
+ exit(EXIT_FAILURE);
}
INSIST(res->ai_addrlen <= sizeof(sa.type));
memmove(&sa.type, res->ai_addr, res->ai_addrlen);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "failed to convert qname: %u\n",
result);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
&servers);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "set server failed: %u\n", result);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "invalid RRtype: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'a':
fprintf(stderr, "only one local "
"address per family "
"can be specified\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
isc_sockaddr_fromin(&a4, &in4, 0);
addr4 = &a4;
fprintf(stderr, "only one local "
"address per family "
"can be specified\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
isc_sockaddr_fromin6(&a6, &in6, 0);
addr6 = &a6;
} else {
fprintf(stderr, "invalid address %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'e':
"alternate server "
"already defined: %s\n",
altserver);
- exit(1);
+ exit(EXIT_FAILURE);
}
altserver = isc_commandline_argument;
break;
"server "
"already defined: %s\n",
server);
- exit(1);
+ exit(EXIT_FAILURE);
}
server = isc_commandline_argument;
break;
if (cp == NULL) {
fprintf(stderr, "invalid alternate server: %s\n",
altserver);
- exit(1);
+ exit(EXIT_FAILURE);
}
*cp = '\0';
altservername = altserver;
result = dst_lib_init(ctxs_mctx, NULL);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dst_lib_init failed: %u\n", result);
- exit(1);
+ exit(EXIT_FAILURE);
}
clientopt = 0;
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_client_create failed: %u, %s\n", result,
isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Set the nameserver */
if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) {
fprintf(stderr, "irs_resconf_load failed: %u\n",
result);
- exit(1);
+ exit(EXIT_FAILURE);
}
nameservers = irs_resconf_getnameservers(resconf);
result = dns_client_setservers(client, dns_rdataclass_in, NULL,
irs_resconf_destroy(&resconf);
fprintf(stderr, "dns_client_setservers failed: %u\n",
result);
- exit(1);
+ exit(EXIT_FAILURE);
}
irs_resconf_destroy(&resconf);
} else {
if (keystr == NULL) {
fprintf(stderr, "key string is missing "
"while key name is provided\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
set_key(client, keynamestr, keystr, is_sep);
}
msg, isc_result_totext(result), __FILE__, \
__LINE__); \
ERR_clear_error(); \
- exit(1); \
+ exit(EXIT_FAILURE); \
} \
} while (0)
{
fprintf(stderr, "fatal error: basic OpenSSL failure\n");
ERR_clear_error();
- exit(1);
+ exit(EXIT_FAILURE);
}
/* e = 0x1000000000001 */
"at file %s line %d\n",
__FILE__, __LINE__);
ERR_clear_error();
- exit(1);
+ exit(EXIT_FAILURE);
}
isc_mem_create(&mctx);
if ((x) != ISC_R_SUCCESS) { \
fprintf(stderr, "I:%s: %s\n", (str), \
isc_result_totext(x)); \
- exit(-1); \
+ exit(EXIT_FAILURE); \
} \
}
if (reqev->result != ISC_R_SUCCESS) {
fprintf(stderr, "I:request event result: %s\n",
isc_result_totext(reqev->result));
- exit(-1);
+ exit(EXIT_FAILURE);
}
query = reqev->ev_arg;
result = dns_result_fromrcode(response->rcode);
fprintf(stderr, "I:response rcode: %s\n",
isc_result_totext(result));
- exit(-1);
+ exit(EXIT_FAILURE);
}
result = dns_tkey_processdhresponse(query, response, ourkey, &nonce,
if (argc < 4) {
fprintf(stderr, "I:no DH key provided\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
ip_address = argv[1];
port = atoi(argv[2]);
if ((x) != ISC_R_SUCCESS) { \
fprintf(stderr, "I:%s: %s\n", (str), \
isc_result_totext(x)); \
- exit(-1); \
+ exit(EXIT_FAILURE); \
} \
}
if (reqev->result != ISC_R_SUCCESS) {
fprintf(stderr, "I:request event result: %s\n",
isc_result_totext(reqev->result));
- exit(-1);
+ exit(EXIT_FAILURE);
}
query = reqev->ev_arg;
result = dns_result_fromrcode(response->rcode);
fprintf(stderr, "I:response rcode: %s\n",
isc_result_totext(result));
- exit(-1);
+ exit(EXIT_FAILURE);
}
result = dns_tkey_processdeleteresponse(query, response, ring);
if (argc < 4) {
fprintf(stderr, "I:no key to delete\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
if (strcmp(argv[1], "-r") == 0) {
fprintf(stderr, "I:The -r options has been deprecated\n");
- exit(-1);
+ exit(EXIT_FAILURE);
}
ip_address = argv[1];
port = atoi(argv[2]);
teardown();
- exit(EXIT_SUCCESS);
+ return (EXIT_SUCCESS);
}
teardown();
- exit(EXIT_SUCCESS);
+ return (EXIT_SUCCESS);
}
if (result != ISC_R_SUCCESS) {
printf("%s: %s\n", msg, isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
}
}
fprintf(stderr, "bad input format: %02x\n", c);
- exit(3);
+ exit(EXIT_FAILURE);
}
static void
break;
default:
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
f = fopen(argv[0], "r");
if (f == NULL) {
fprintf(stderr, "%s: fopen failed\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
need_close = true;
} else {
if (len % 2 != 0U) {
fprintf(stderr, "bad input format: %lu\n",
(unsigned long)len);
- exit(1);
+ exit(EXIT_FAILURE);
}
rp = s;
if (isc_buffer_remaininglength(input) < 2) {
fprintf(stderr, "premature end of packet\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
tcplen = isc_buffer_getuint16(input);
if (isc_buffer_remaininglength(input) < tcplen) {
fprintf(stderr, "premature end of packet\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
process_message(input);
}
break;
default:
usage();
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if ((x) != ISC_R_SUCCESS) { \
fprintf(stderr, "mdig: %s failed with %s\n", (str), \
isc_result_totext(x)); \
- exit(-1); \
+ exit(EXIT_FAILURE); \
} \
}
if (continue_on_error) {
goto cleanup;
} else {
- exit(-1);
+ exit(EXIT_FAILURE);
}
}
" {local-opt} [ host {local-opt} [...]]\n"
"\nUse \"mdig -h\" (or \"mdig -h | more\") "
"for complete list of options\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
/*% help */
break;
case 'h':
help();
- exit(0);
+ exit(EXIT_SUCCESS);
break;
case 'i':
/* deprecated */
break;
case 'v':
fprintf(stderr, "mDiG %s\n", PACKAGE_VERSION);
- exit(0);
+ exit(EXIT_SUCCESS);
break;
}
if (strlen(option) > 1U) {
static void
usage(void) {
fprintf(stderr, "Usage: %s [-dux] journal\n", progname);
- exit(1);
+ exit(EXIT_FAILURE);
}
/*
if (endp == isc_commandline_argument || *endp != 0) {
fprintf(stderr, "invalid serial: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
case 'd':
if (argc != 2) {
fprintf(stderr, "Usage: named-nzd2nzf <nzd-path>\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
path = argv[1];
if (status != MDB_SUCCESS) {
fprintf(stderr, "named-nzd2nzf: mdb_env_create: %s",
mdb_strerror(status));
- exit(1);
+ exit(EXIT_FAILURE);
}
status = mdb_env_open(env, path, DNS_LMDB_FLAGS, 0600);
if (status != MDB_SUCCESS) {
fprintf(stderr, "named-nzd2nzf: mdb_env_open: %s",
mdb_strerror(status));
- exit(1);
+ exit(EXIT_FAILURE);
}
status = mdb_txn_begin(env, 0, MDB_RDONLY, &txn);
if (status != MDB_SUCCESS) {
fprintf(stderr, "named-nzd2nzf: mdb_txn_begin: %s",
mdb_strerror(status));
- exit(1);
+ exit(EXIT_FAILURE);
}
status = mdb_dbi_open(txn, NULL, 0, &dbi);
if (status != MDB_SUCCESS) {
fprintf(stderr, "named-nzd2nzf: mdb_dbi_open: %s",
mdb_strerror(status));
- exit(1);
+ exit(EXIT_FAILURE);
}
status = mdb_cursor_open(txn, dbi, &cursor);
if (status != MDB_SUCCESS) {
fprintf(stderr, "named-nzd2nzf: mdb_cursor_open: %s",
mdb_strerror(status));
- exit(1);
+ exit(EXIT_FAILURE);
}
for (status = mdb_cursor_get(cursor, &key, &data, MDB_FIRST);
"named-nzd2nzf: empty column found in "
"database '%s'",
path);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* zone zonename { config; }; */
mdb_cursor_close(cursor);
mdb_txn_abort(txn);
mdb_env_close(env);
- exit(0);
+
+ return (0);
}
fprintf(stderr, "\t-P: list the supported private type names\n");
fprintf(stderr, "\t-T: list the supported standard type names\n");
fprintf(stderr, "\t-u: print the record in unknown record format\n");
- exit(0);
+ exit(EXIT_SUCCESS);
}
static void
fprintf(stdout, "%s\n", text);
}
}
- exit(0);
+ exit(EXIT_SUCCESS);
case 'P':
for (t = 0xff00; t <= 0xfffeu; t++) {
default:
fprintf(stderr, "%s: unhandled option -%c\n", argv[0],
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (doexit) {
- exit(0);
+ exit(EXIT_SUCCESS);
}
isc_mem_create(&mctx);
program);
fprintf(stderr, " %s -r algorithm flags iterations salt domain\n",
program);
- exit(1);
+ exit(EXIT_FAILURE);
}
typedef void
vfprintf(stderr, format, args);
va_end(args);
fprintf(stderr, ": %s\n", isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
static void
fprintf(stderr, "usage: cfg_test --rndc|--named "
"[--grammar] [--zonegrammar] [--active] "
"[--memstats] conffile\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
int
fprintf(stderr, "read config: %s\n", isc_result_totext(result));
if (result != ISC_R_SUCCESS) {
- exit(1);
+ exit(EXIT_FAILURE);
}
cfg_print(cfg, output, NULL);
if (ferror(stdout)) {
fprintf(stderr, "write error\n");
return (1);
- } else {
- return (0);
}
+
+ return (0);
}
fprintf(stderr,
"Error: reading directory: %s\n",
strerror(errno));
- exit(1);
+ exit(EXIT_FAILURE);
}
}
}
fprintf(stderr,
"Error: type %d has two names: %s, %s\n", type,
typenames[i].typebuf, typebuf);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (typenames[i].typebuf[0] == 0 && ttn == NULL) {
ttn = &typenames[i];
}
if (ttn == NULL) {
fprintf(stderr, "Error: typenames array too small\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* XXXMUKS: This is redundant due to the INSIST above. */
if (strlen(typebuf) > sizeof(ttn->typebuf) - 1) {
fprintf(stderr, "Error: type name %s is too long\n", typebuf);
- exit(1);
+ exit(EXIT_FAILURE);
}
strncpy(ttn->typebuf, typebuf, sizeof(ttn->typebuf));
"Error: type %d has different attributes: "
"%s, %s\n",
type, ttn->attr, attr);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (strlen(attr) > sizeof(ttn->attr) - 1) {
fprintf(stderr, "Error: attr (%s) [name %s] is too long\n",
attr, typebuf);
- exit(1);
+ exit(EXIT_FAILURE);
}
strncpy(ttn->attr, attr, sizeof(ttn->attr));
if (newtt == NULL) {
fprintf(stderr, "malloc() failed\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
newtt->next = NULL;
while ((tt != NULL) && (tt->type == type) && (tt->rdclass < rdclass)) {
if (strcmp(tt->typebuf, typebuf) != 0) {
- exit(1);
+ exit(EXIT_FAILURE);
}
oldtt = tt;
tt = tt->next;
}
if ((tt != NULL) && (tt->type == type) && (tt->rdclass == rdclass)) {
- exit(1);
+ exit(EXIT_FAILURE);
}
newtt->next = tt;
newcc = (struct cc *)malloc(sizeof(*newcc));
if (newcc == NULL) {
fprintf(stderr, "malloc() failed\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
newcc->rdclass = rdclass;
strncpy(newcc->classbuf, classbuf, sizeof(newcc->classbuf));
if (type > 65535) {
fprintf(stderr, "Error: type value > 65535 (%s)\n",
dir.filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
add(rdclass, classbuf, type, typebuf, dirbuf);
}
n = strlen(string);
if (n == 0) {
fprintf(stderr, "n == 0?\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
a = tolower((unsigned char)string[0]);
b = tolower((unsigned char)string[n - 1]);
sizeof("/rdata/_65535_65535"))
{
fprintf(stderr, "\"%s\" too long\n", optarg);
- exit(1);
+ exit(EXIT_FAILURE);
}
n = snprintf(srcdir, sizeof(srcdir), "%s/", optarg);
INSIST(n > 0 && (unsigned)n < sizeof(srcdir));
suffix = optarg;
break;
case '?':
- exit(1);
+ exit(EXIT_FAILURE);
}
}
INSIST(n > 0 && (unsigned)n < sizeof(srcdir));
if (!start_directory(buf, &dir)) {
- exit(1);
+ exit(EXIT_FAILURE);
}
while (next_file(&dir)) {
if (rdclass > 65535) {
fprintf(stderr, "Error: class value > 65535 (%s)\n",
dir.filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
sd(rdclass, classbuf, buf, filetype);
}
}
if (ferror(stdout) != 0) {
- exit(1);
+ exit(EXIT_FAILURE);
}
return (0);
if (FIPS_mode_set(1) == 0) {
dst__openssl_toresult2("FIPS_mode_set", DST_R_OPENSSLFAILURE);
- exit(1);
+ exit(EXIT_FAILURE);
}
#endif /* HAVE_FIPS_MODE */
}
if (atomic_load_acquire(&ctx->want_shutdown) &&
atomic_load_acquire(&ctx->blocked))
{
- exit(1);
+ exit(EXIT_FAILURE);
}
}