From 38ffc26b576e63aa7793c13419bb67cb222b81a1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 20 Nov 1999 04:58:24 +0000 Subject: [PATCH] (__xdr_ypresp_all): Call callback function for errors, too, like Solaris does. --- nis/ypclnt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nis/ypclnt.c b/nis/ypclnt.c index cfda29a668d..af489fd4676 100644 --- a/nis/ypclnt.c +++ b/nis/ypclnt.c @@ -628,6 +628,9 @@ __xdr_ypresp_all (XDR *xdrs, u_long *objp) int keylen = resp.ypresp_all_u.val.key.keydat_len; int vallen = resp.ypresp_all_u.val.val.valdat_len; + /* XXX We are not allowed to modify the key and val data. + But I don't know if all other code will continue to work, + so we will fix this for glibc 2.2 */ *objp = YP_TRUE; memcpy (key, resp.ypresp_all_u.val.key.keydat_val, keylen); key[keylen] = '\0'; @@ -639,14 +642,13 @@ __xdr_ypresp_all (XDR *xdrs, u_long *objp) return TRUE; } break; - case YP_NOMORE: - *objp = YP_NOMORE; - xdr_free ((xdrproc_t) xdr_ypresp_all, (char *) &resp); - return TRUE; - break; default: *objp = resp.ypresp_all_u.val.stat; xdr_free ((xdrproc_t) xdr_ypresp_all, (char *) &resp); + /* Sun says we don't need to make this call, but must return + immediatly. Since Solaris makes this call, we will call + the callback function, too. */ + (*ypall_foreach) (*objp, NULL, 0, NULL, 0, ypall_data); return TRUE; } } -- 2.47.2