[patch] fix wrong comparison in yp_order

Carlos O'Donell carlos@codesourcery.com
Sat Mar 1 12:52:00 GMT 2008


Jeff Moyer wrote:
> yp_order always returns 0 for the map order.  The reason is pretty
> simple:

Jeff,

Could you file a bug for this in the bugzilla, and attach a patch with a 
ChangeLog? A description of how you tested this would also be great e.g. 
Setup NIS server etc etc.

> int
> yp_order (const char *indomain, const char *inmap, unsigned int *outorder)
> {
> ...
>   result = do_ypcall_tr (indomain, YPPROC_ORDER, (xdrproc_t) xdr_ypreq_nokey,
> 			 (caddr_t) &req, (xdrproc_t) xdr_ypresp_order,
> 			 (caddr_t) &resp);
> 
>   if (result == YPERR_SUCCESS)  <=============
>     return result;
> 
>   *outorder = resp.ordernum;
>   xdr_free ((xdrproc_t) xdr_ypresp_order, (char *) &resp);
> 
>   return result;
> }
> 
> That check should actually be !=.  The attached patch addresses this.
> Note: I have a build running currently, but have not yet tested it.

I agree that that looks incorrect.

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716



More information about the Libc-alpha mailing list