X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Fpdu.c;h=d7426ced53c82a50748b243d130b09ad2c1dab06;hb=75e8e264d68f241b2e4d5b4a846e90cda1266630;hp=d6e823201e99393efa9d1bd3df0988da44c27ef2;hpb=1b9917b8866a74edf06b80668e44ed0e593a47b9;p=deb_libnfs.git
diff --git a/lib/pdu.c b/lib/pdu.c
index d6e8232..d7426ce 100644
--- a/lib/pdu.c
+++ b/lib/pdu.c
@@ -14,9 +14,16 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see .
*/
+#ifdef WIN32
+#include "win32_compat.h"
+#ifndef MSG_DONTWAIT
+#define MSG_DONTWAIT 0
+#endif
+#else
+#include
+#endif/*WIN32*/
#include
-#include
#include
#include
#include
@@ -41,7 +48,7 @@ struct rpc_pdu *rpc_allocate_pdu(struct rpc_context *rpc, int program, int versi
rpc_set_error(rpc, "Out of memory: Failed to allocate pdu structure");
return NULL;
}
- bzero(pdu, sizeof(struct rpc_pdu));
+ memset(pdu, 0, sizeof(struct rpc_pdu));
pdu->xid = rpc->xid++;
pdu->cb = cb;
pdu->private_data = private_data;
@@ -53,7 +60,7 @@ struct rpc_pdu *rpc_allocate_pdu(struct rpc_context *rpc, int program, int versi
xdr_setpos(&pdu->xdr, 4); /* skip past the record marker */
}
- bzero(&msg, sizeof(struct rpc_msg));
+ memset(&msg, 0, sizeof(struct rpc_msg));
msg.rm_xid = pdu->xid;
msg.rm_direction = CALL;
msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
@@ -146,7 +153,7 @@ static int rpc_process_reply(struct rpc_context *rpc, struct rpc_pdu *pdu, XDR *
{
struct rpc_msg msg;
- bzero(&msg, sizeof(struct rpc_msg));
+ memset(&msg, 0, sizeof(struct rpc_msg));
msg.acpted_rply.ar_verf = _null_auth;
if (pdu->xdr_decode_bufsize > 0) {
if (pdu->xdr_decode_buf != NULL) {
@@ -158,7 +165,7 @@ static int rpc_process_reply(struct rpc_context *rpc, struct rpc_pdu *pdu, XDR *
pdu->cb(rpc, RPC_STATUS_ERROR, "Failed to allocate buffer for decoding of XDR reply", pdu->private_data);
return 0;
}
- bzero(pdu->xdr_decode_buf, pdu->xdr_decode_bufsize);
+ memset(pdu->xdr_decode_buf, 0, pdu->xdr_decode_bufsize);
}
msg.acpted_rply.ar_results.where = pdu->xdr_decode_buf;
msg.acpted_rply.ar_results.proc = pdu->xdr_decode_fn;
@@ -210,7 +217,7 @@ int rpc_process_pdu(struct rpc_context *rpc, char *buf, int size)
int pos, recordmarker;
unsigned int xid;
- bzero(&xdr, sizeof(XDR));
+ memset(&xdr, 0, sizeof(XDR));
xdrmem_create(&xdr, buf, size, XDR_DECODE);
if (rpc->is_udp == 0) {