]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Creation of receive endpoint returns socket
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 27 Nov 2009 07:40:52 +0000 (08:40 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 27 Nov 2009 07:40:52 +0000 (08:40 +0100)
We need this for ffmpeg integration

fwp/lib/fwp/fwp_endpoint.c

index 6c2bf6855039fb6392eb4355a8b8560f5fa757de..fb91688eafc3a752a051f5dab7e9aa5126ce3529 100644 (file)
@@ -179,7 +179,7 @@ int fwp_endpoint_attr_init(fwp_endpoint_attr_t *attr)
  * \param[in] attr Endpoint attributes
  * \param[out] epp  Pointer to the descriptor of newly created endpoint
  *
- * \return Zero on success, -1 on error and sets errno appropriately. 
+ * \return Non-negative number on success, -1 on error and sets errno appropriately. 
  *
  */
 int fwp_send_endpoint_create(unsigned int node,
@@ -276,7 +276,7 @@ err:
  * \param[in] attr Endpoint attributes
  * \param[out] epointdp  Pointer to the descriptor of newly created endpoint
  *
- * \return Zero on success, -1 on error and errno is set.
+ * \return Non-negative number on success, -1 on error and errno is set.
  */
 int fwp_receive_endpoint_create(unsigned int port,
                                fwp_endpoint_attr_t *attr,
@@ -377,10 +377,10 @@ int fwp_receive_endpoint_create(unsigned int port,
        fwp_epoint->port = ntohs(addr->sin_port);
        FWP_DEBUG("Recv port= %d\n",ntohs(addr->sin_port));     
        *epp = fwp_epoint;
-       return 0;
+       return fwp_epoint->sockd;
 err:
        fwp_endpoint_destroy(fwp_epoint);
-       return errno;
+       return -1;
 }
 
 /**