change the portmapper structure 'mapping' to 'pmap_mapping'
[deb_libnfs.git] / portmap / portmap.c
index 1e51a8f1dae803c1a2618c122423d28e6c7a01ad..d8015d968d6e396f775fd94dd420cf646d68db6e 100644 (file)
@@ -37,7 +37,7 @@ int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
        if (rpc_queue_pdu(rpc, pdu) != 0) {
                rpc_set_error(rpc, "Out of memory. Failed to queue pdu for portmap/null call");
                rpc_free_pdu(rpc, pdu);
-               return -2;
+               return -1;
        }
 
        return 0;
@@ -46,7 +46,7 @@ int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
 int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data)
 {
        struct rpc_pdu *pdu;
-       struct mapping m;
+       struct pmap_mapping m;
 
        pdu = rpc_allocate_pdu(rpc, PMAP_PROGRAM, PMAP_V2, PMAP_GETPORT, cb, private_data, (xdrproc_t)xdr_int, sizeof(uint32_t));
        if (pdu == NULL) {
@@ -58,16 +58,16 @@ int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rp
        m.vers = version;
        m.prot = IPPROTO_TCP;
        m.port = 0;
-       if (xdr_mapping(&pdu->xdr, &m) == 0) {
+       if (xdr_pmap_mapping(&pdu->xdr, &m) == 0) {
                rpc_set_error(rpc, "XDR error: Failed to encode data for portmap/getport call");
                rpc_free_pdu(rpc, pdu);
-               return -2;
+               return -1;
        }
 
        if (rpc_queue_pdu(rpc, pdu) != 0) {
-               printf("Failed to queue portmap/getport pdu\n");
+               rpc_set_error(rpc, "Failed to queue portmap/getport pdu");
                rpc_free_pdu(rpc, pdu);
-               return -2;
+               return -1;
        }
 
        return 0;