Date: Sat, 23 Jun 2001 14:54:48 -0700 (PDT) From: Ian Dowse <iedowse@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.sbin/rpcbind rpcb_svc_com.c Message-ID: <200106232154.f5NLsmO69914@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
iedowse 2001/06/23 14:54:47 PDT
Modified files:
usr.sbin/rpcbind rpcb_svc_com.c
Log:
Fix some return-value brain-damage in forward_register(). This
function has a return type of u_int32_t, into which it was somehow
supposed to encode:
* A valid 32-bit XID (which could be any value including 0).
* 0, meaning a duplicate request.
* -1, meaning a malloc failed (!);
We now ensure that all XIDs are non-zero, and pass the XID out via
a pointer argument.
In forward_find() and free_slot_by_xid(), remove an unnecessary
and confusing test for a negative result from an unsigned modulo
operation, but add an unnecessary cast to highlight why.
Revision Changes Path
1.3 +22 -17 src/usr.sbin/rpcbind/rpcb_svc_com.c
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106232154.f5NLsmO69914>
