summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-12-16 22:05:10 +0000
committerdim <dim@FreeBSD.org>2011-12-16 22:05:10 +0000
commitf993aa3b863809756f87bebcf680317da2ba883a (patch)
tree68350e27a01812778e1eb9f628ab781826b880c7
parentca3809987c8b011d422ebb5ab09c96ca7fbbbf8a (diff)
downloadFreeBSD-src-f993aa3b863809756f87bebcf680317da2ba883a.zip
FreeBSD-src-f993aa3b863809756f87bebcf680317da2ba883a.tar.gz
Fix the incompatible enum conversions in libexec/ypxfr in another, more
messy way, so as to not disrupt other yp programs: just add casts to convert the incompatible enums, as the numerical values are the same (either by accident, design, or the phase of the moon at that time). MFC after: 1 week
-rw-r--r--libexec/ypxfr/ypxfr_getmap.c4
-rw-r--r--libexec/ypxfr/ypxfr_main.c10
-rw-r--r--libexec/ypxfr/ypxfr_misc.c32
3 files changed, 24 insertions, 22 deletions
diff --git a/libexec/ypxfr/ypxfr_getmap.c b/libexec/ypxfr/ypxfr_getmap.c
index 452b186..4b8794f 100644
--- a/libexec/ypxfr/ypxfr_getmap.c
+++ b/libexec/ypxfr/ypxfr_getmap.c
@@ -73,7 +73,7 @@ ypxfr_get_map(char *map, char *domain, char *host,
if ((clnt = clnt_create(host, YPPROG, YPVERS, "tcp")) == NULL) {
yp_error("%s", clnt_spcreateerror("failed to \
create tcp handle"));
- yp_errno = YPXFR_YPERR;
+ yp_errno = (enum ypstat)YPXFR_YPERR;
return(1);
}
@@ -91,7 +91,7 @@ create tcp handle"));
return(0);
if (status != YP_TRUE) {
- yp_errno = YPXFR_YPERR;
+ yp_errno = (enum ypstat)YPXFR_YPERR;
return(1);
}
diff --git a/libexec/ypxfr/ypxfr_main.c b/libexec/ypxfr/ypxfr_main.c
index f6b478a..70fd1f5 100644
--- a/libexec/ypxfr/ypxfr_main.c
+++ b/libexec/ypxfr/ypxfr_main.c
@@ -88,7 +88,7 @@ ypxfr_exit(ypxfrstat retval, char *temp)
exit(1);
}
- ypxfr_resp.status = retval;
+ ypxfr_resp.status = (yppush_status)retval;
if (yppushproc_xfrresp_1(&ypxfr_resp, clnt) == NULL) {
yp_error("%s", clnt_sperror(clnt, "callback failed"));
@@ -329,7 +329,7 @@ the local domain name isn't set");
ypxfr_use_yplib)) == NULL) {
yp_error("failed to find master of %s in domain %s: %s",
ypxfr_mapname, ypxfr_source_domain,
- ypxfrerr_string(yp_errno));
+ ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_MADDR,NULL);
}
}
@@ -358,7 +358,8 @@ the local domain name isn't set");
ypxfr_master, 0)) == 0) {
yp_error("failed to get order number of %s: %s",
ypxfr_mapname, yp_errno == YPXFR_SUCC ?
- "map has order 0" : ypxfrerr_string(yp_errno));
+ "map has order 0" :
+ ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_YPERR,NULL);
}
@@ -533,7 +534,8 @@ leave:
ypxfr_master, 0)) == 0) {
yp_error("failed to get order number of %s: %s",
ypxfr_mapname, yp_errno == YPXFR_SUCC ?
- "map has order 0" : ypxfrerr_string(yp_errno));
+ "map has order 0" :
+ ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_YPERR,ypxfr_temp_map);
}
diff --git a/libexec/ypxfr/ypxfr_misc.c b/libexec/ypxfr/ypxfr_misc.c
index 726abec..323fd53 100644
--- a/libexec/ypxfr/ypxfr_misc.c
+++ b/libexec/ypxfr/ypxfr_misc.c
@@ -130,14 +130,14 @@ ypxfr_get_master(char *domain, char *map, char *source, const int yplib)
if ((res = yp_master(domain, map, &master))) {
switch (res) {
case YPERR_DOMAIN:
- yp_errno = YPXFR_NODOM;
+ yp_errno = (enum ypstat)YPXFR_NODOM;
break;
case YPERR_MAP:
- yp_errno = YPXFR_NOMAP;
+ yp_errno = (enum ypstat)YPXFR_NOMAP;
break;
case YPERR_YPERR:
default:
- yp_errno = YPXFR_YPERR;
+ yp_errno = (enum ypstat)YPXFR_YPERR;
break;
}
return(NULL);
@@ -154,7 +154,7 @@ ypxfr_get_master(char *domain, char *map, char *source, const int yplib)
if ((clnt = clnt_create(source,YPPROG,YPVERS,"udp")) == NULL) {
yp_error("%s",clnt_spcreateerror("failed to \
create udp handle to ypserv"));
- yp_errno = YPXFR_RPC;
+ yp_errno = (enum ypstat)YPXFR_RPC;
return(NULL);
}
@@ -164,21 +164,21 @@ create udp handle to ypserv"));
yp_error("%s",clnt_sperror(clnt,"YPPROC_MASTER \
failed"));
clnt_destroy(clnt);
- yp_errno = YPXFR_RPC;
+ yp_errno = (enum ypstat)YPXFR_RPC;
return(NULL);
}
clnt_destroy(clnt);
if (resp->stat != YP_TRUE) {
switch (resp->stat) {
case YP_NODOM:
- yp_errno = YPXFR_NODOM;
+ yp_errno = (enum ypstat)YPXFR_NODOM;
break;
case YP_NOMAP:
- yp_errno = YPXFR_NOMAP;
+ yp_errno = (enum ypstat)YPXFR_NOMAP;
break;
case YP_YPERR:
default:
- yp_errno = YPXFR_YPERR;
+ yp_errno = (enum ypstat)YPXFR_YPERR;
break;
}
return(NULL);
@@ -198,14 +198,14 @@ ypxfr_get_order(char *domain, char *map, char *source, const int yplib)
if ((res = yp_order(domain, map, &order))) {
switch (res) {
case YPERR_DOMAIN:
- yp_errno = YPXFR_NODOM;
+ yp_errno = (enum ypstat)YPXFR_NODOM;
break;
case YPERR_MAP:
- yp_errno = YPXFR_NOMAP;
+ yp_errno = (enum ypstat)YPXFR_NOMAP;
break;
case YPERR_YPERR:
default:
- yp_errno = YPXFR_YPERR;
+ yp_errno = (enum ypstat)YPXFR_YPERR;
break;
}
return(0);
@@ -219,7 +219,7 @@ ypxfr_get_order(char *domain, char *map, char *source, const int yplib)
if ((clnt = clnt_create(source,YPPROG,YPVERS,"udp")) == NULL) {
yp_error("%s",clnt_spcreateerror("couldn't create \
udp handle to ypserv"));
- yp_errno = YPXFR_RPC;
+ yp_errno = (enum ypstat)YPXFR_RPC;
return(0);
}
req.map = map;
@@ -228,21 +228,21 @@ udp handle to ypserv"));
yp_error("%s", clnt_sperror(clnt, "YPPROC_ORDER \
failed"));
clnt_destroy(clnt);
- yp_errno = YPXFR_RPC;
+ yp_errno = (enum ypstat)YPXFR_RPC;
return(0);
}
clnt_destroy(clnt);
if (resp->stat != YP_TRUE) {
switch (resp->stat) {
case YP_NODOM:
- yp_errno = YPXFR_NODOM;
+ yp_errno = (enum ypstat)YPXFR_NODOM;
break;
case YP_NOMAP:
- yp_errno = YPXFR_NOMAP;
+ yp_errno = (enum ypstat)YPXFR_NOMAP;
break;
case YP_YPERR:
default:
- yp_errno = YPXFR_YPERR;
+ yp_errno = (enum ypstat)YPXFR_YPERR;
break;
}
return(0);
OpenPOWER on IntegriCloud