Error out if we can't determine the YP domain name to be used for

the RPC.
This commit is contained in:
thorpej 1996-08-09 20:24:34 +00:00
parent 34ca0ef5c8
commit 5bf41ee467
1 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: yppush.c,v 1.2 1996/08/09 20:18:50 thorpej Exp $ */
/* $NetBSD: yppush.c,v 1.3 1996/08/09 20:24:34 thorpej Exp $ */
/*
* Copyright (c) 1995 Mats O Jansson <moj@stacken.kth.se>
@ -92,7 +92,7 @@ main(argc, argv)
if (atexit(cleanup))
err(1, "can't register cleanup function");
yp_get_default_domain(&domain);
domain = NULL;
hostname = NULL;
while ((c = getopt(argc, argv, "d:h:v")) != -1) {
@ -121,6 +121,11 @@ main(argc, argv)
map = argv[0];
if (domain == NULL)
if ((c = yp_get_default_domain(&domain)))
errx(1, "can't get YP domain name. Reason: %s",
yperr_string(c));
memset(Domain, 0, sizeof(Domain));
snprintf(Domain, sizeof(Domain), "%s", domain);
memset(Map, 0, sizeof(Map));