From 63ffcdd958109682677ba946f0cc3f89acfd45ec Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Thu, 14 Oct 2021 17:48:23 +0200 Subject: [PATCH] test: zephyr: fix 'errno' undeclared The return value should be negative. Added inclusion of errno.h to avoid an unresolved symbol error when linking the test. Signed-off-by: Arnaud Pouliquen --- test/system/zephyr/alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/system/zephyr/alloc.c b/test/system/zephyr/alloc.c index e3b86df..2944b62 100644 --- a/test/system/zephyr/alloc.c +++ b/test/system/zephyr/alloc.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -19,7 +20,7 @@ static int alloc(void) ptr = metal_allocate_memory(1000); if (!ptr) { metal_log(METAL_LOG_DEBUG, "failed to allocate memmory\n"); - return errno; + return -errno; } metal_free_memory(ptr);