]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Fix allocator error reporting
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 10 Nov 2009 10:00:03 +0000 (11:00 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 10 Nov 2009 10:00:33 +0000 (11:00 +0100)
fwp/lib/frsh_fwp/fwp_fra.c
fwp/lib/fwp/fwp_vres.c

index f6e15c4bdb7070c60195e5113d48a6f71ccedb1b..0f5f1ac726b8ebc5c87ec8993649315bb02f6ddf 100644 (file)
@@ -88,9 +88,9 @@ static int create_vres(fres_vres_t *vres, void *priv)
                snprintf(src, sizeof(src), "%s", inet_ntoa(vparams.src));
        }
        /* Create vres */
-       if ((rv = fwp_vres_create(&vparams, &fwp_vres))) {
-               return  rv;
-       }
+       if ((rv = fwp_vres_create(&vparams, &fwp_vres)))
+               return (rv == -1) ? errno : rv;
+
        vres->priv = fwp_vres;
 
        fres_contract_id_to_string(id, &vres->id, sizeof(id));
index 1a4de36588a577119b9b42da65525bcc059d5743..ad5bacbf36e92cd160a64cef2d65be66b90dedee 100644 (file)
@@ -285,9 +285,8 @@ out:
  * \param[in] params Vres parameters
  * \param[out] vresp Pointer to the descriptor of newly created vres
  *
- * \return On success returns descriptor of vres. 
- * On error, negative error code is returned. 
- *
+ * \return Zero on success, -1 on error and errno is set
+ * appropriately.
  */
 int fwp_vres_create(fwp_vres_params_t *params, fwp_vres_t **vresp)
 {
@@ -331,9 +330,8 @@ err:
  *
  * \param[in] vres Vres descriptor
  *
- * \return On success returns 0. 
- * On error, negative error code is returned. 
- *
+ * \return Zero on success, -1 on error and errno is set
+ * appropriately.
  */
 int fwp_vres_destroy(fwp_vres_t *vres)
 {