]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
changed return value in fwp_contract_negotiate
authorMartin Molnar <molnar@sum.(none)>
Mon, 28 Jan 2008 14:59:46 +0000 (15:59 +0100)
committerMartin Molnar <molnar@sum.(none)>
Mon, 28 Jan 2008 14:59:46 +0000 (15:59 +0100)
fwp/libfwp/src/fwp_proto.c

index b076d85114c58074689c5a836e2c21f61f80c4b8..2a4ac3982cae8ffef9f932753ce4c3539847dfae 100644 (file)
@@ -105,12 +105,15 @@ int fwp_send(unsigned int vres_id, void *buffer, size_t size, int flags,
  * fwp agent and then waits for response.
  *
  * \param contract Contract to negotiate
+ * \param vres_id Id of vres if the contract was negotiated
  *
- * \return It returns non-zero value if the contract is negotiated
- *
+ * \return It returns value 0 when the contract negotiation process was 
+ * successful with the result stored in contract->status. 
+ * On error, negative error code is returned.
+ * 
  */
 
-int fwp_contract_negotiate(struct fwp_contract *contract)
+int fwp_contract_negotiate(struct fwp_contract *contract, int *vres_id)
 {
        struct fwp_msgb *msgb;
        unsigned int code, hid;
@@ -150,12 +153,12 @@ int fwp_contract_negotiate(struct fwp_contract *contract)
 
        if (contract->status == FWP_CNT_NEGOTIATED) {
                FWP_DEBUG("Contract negotiated\n");
-               return fwp_vres_open(contract);
+               *vres_id = fwp_vres_open(contract);
        } 
 
        fwp_msgb_free(msgb);
        
-       return -1;
+       return 0;
 }
 
 int fwp_contract_cancel(unsigned int vres_id)