From 8f553bfb278901f5dc387bbf85dbdf3ba58f3397 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 16 Dec 2011 19:39:49 +0000 Subject: Attempt to fix the numerous incompatible enum conversions in libexec/ypxfr in the least disruptive way. MFC after: 1 week --- libexec/ypxfr/yp_dbwrite.c | 10 +++++----- libexec/ypxfr/ypxfr_extern.h | 2 +- libexec/ypxfr/ypxfr_getmap.c | 1 - libexec/ypxfr/ypxfr_main.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'libexec/ypxfr') diff --git a/libexec/ypxfr/yp_dbwrite.c b/libexec/ypxfr/yp_dbwrite.c index 488f9e4ad446..c44932da3283 100644 --- a/libexec/ypxfr/yp_dbwrite.c +++ b/libexec/ypxfr/yp_dbwrite.c @@ -58,10 +58,10 @@ yp_open_db_rw(const char *domain, const char *map, const int flags) char buf[1025]; - yp_errno = YP_TRUE; + yp_errno = YPXFR_SUCC; if (map[0] == '.' || strchr(map, '/')) { - yp_errno = YP_BADARGS; + yp_errno = YPXFR_BADARGS; return (NULL); } @@ -73,13 +73,13 @@ yp_open_db_rw(const char *domain, const char *map, const int flags) if (dbp == NULL) { switch (errno) { case ENOENT: - yp_errno = YP_NOMAP; + yp_errno = YPXFR_NOMAP; break; case EFTYPE: - yp_errno = YP_BADDB; + yp_errno = YPXFR_MADDR; break; default: - yp_errno = YP_YPERR; + yp_errno = YPXFR_YPERR; break; } } diff --git a/libexec/ypxfr/ypxfr_extern.h b/libexec/ypxfr/ypxfr_extern.h index f843b645b6dd..67aede1b03f4 100644 --- a/libexec/ypxfr/ypxfr_extern.h +++ b/libexec/ypxfr/ypxfr_extern.h @@ -46,7 +46,7 @@ extern BTREEINFO openinfo_b; extern char *yp_dir; extern int debug; -extern enum ypstat yp_errno; +extern ypxfrstat yp_errno; extern void yp_error(const char *, ...); extern int _yp_check(char **); extern const char *ypxfrerr_string(ypxfrstat); diff --git a/libexec/ypxfr/ypxfr_getmap.c b/libexec/ypxfr/ypxfr_getmap.c index 452b18667ad3..c9c1f2f30ecc 100644 --- a/libexec/ypxfr/ypxfr_getmap.c +++ b/libexec/ypxfr/ypxfr_getmap.c @@ -46,7 +46,6 @@ extern bool_t xdr_ypresp_all_seq(XDR *, unsigned long *); int (*ypresp_allfn)(); void *ypresp_data; extern DB *specdbp; -extern enum ypstat yp_errno; /* * This is largely the same as yp_all() except we do the transfer diff --git a/libexec/ypxfr/ypxfr_main.c b/libexec/ypxfr/ypxfr_main.c index f6b478a89d3c..7e4e24302920 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")); -- cgit v1.2.3