From: Ronnie Sahlberg Date: Sun, 8 Jun 2014 14:21:43 +0000 (-0700) Subject: init.c: use list macro when removing pdus from the wait list X-Git-Tag: upstream/1.9.6^2~35 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=1a6ec3ee76a2e33d6c86ad81d00922dabe426f50;hp=a1911b0144768c0d67ffd2a000a8e34de39e490e init.c: use list macro when removing pdus from the wait list Use the macro when removing the pdus in the wait list from the queues. Also make sure to remove them from the right queue, from waitqueue and not the outqueue for PDUs we have already sent out. Signed-off-by: Ronnie Sahlberg --- diff --git a/lib/init.c b/lib/init.c index 782a7ea..bbed183 100644 --- a/lib/init.c +++ b/lib/init.c @@ -235,7 +235,7 @@ void rpc_destroy_context(struct rpc_context *rpc) while((pdu = rpc->outqueue.head) != NULL) { pdu->cb(rpc, RPC_STATUS_CANCEL, NULL, pdu->private_data); - rpc->outqueue.head = pdu->next; + LIBNFS_LIST_REMOVE(&rpc->outqueue.head, pdu); rpc_free_pdu(rpc, pdu); } @@ -244,7 +244,7 @@ void rpc_destroy_context(struct rpc_context *rpc) while((pdu = q->head) != NULL) { pdu->cb(rpc, RPC_STATUS_CANCEL, NULL, pdu->private_data); - rpc->outqueue.head = pdu->next; + LIBNFS_LIST_REMOVE(&q->head, pdu); rpc_free_pdu(rpc, pdu); } }