tldk: fix for wrong rte_errno value in event.c 25/3525/1
authorKarol Latecki <karolx.latecki@intel.com>
Wed, 19 Oct 2016 22:18:16 +0000 (18:18 -0400)
committerKarol Latecki <karolx.latecki@intel.com>
Fri, 21 Oct 2016 08:42:31 +0000 (10:42 +0200)
Change-Id: Ia4890e174fa5e19ccfaeb23c1ba3e3d69f841af7
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>
lib/libtle_udp/event.c
test/gtest/test_tle_udp_event.cpp

index 7e340e8..66c5a3b 100644 (file)
@@ -79,7 +79,7 @@ tle_event_alloc(struct tle_evq *evq, const void *data)
                evq->nb_free--;
                h->data = data;
        } else
-               rte_errno = -ENOMEM;
+               rte_errno = ENOMEM;
        rte_spinlock_unlock(&evq->lock);
        return h;
 }
index 6d5c548..c7c25a0 100644 (file)
@@ -78,7 +78,7 @@ TEST_F(udp_event, udp_event_alloc_free_max_reached)
 
        last_event = tle_event_alloc(evq, (void *) &fake_data);
        ASSERT_EQ(last_event, (struct tle_event *) NULL);
-       ASSERT_EQ(rte_errno, -ENOMEM);
+       ASSERT_EQ(rte_errno, ENOMEM);
 
        for (i = 1; i <= max_events; i++) {
                tle_event_free(event);