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 <arnaud.pouliquen@foss.st.com>
This commit is contained in:
Arnaud Pouliquen
2021-10-20 09:05:25 +02:00
committed by Arnaud Pouliquen
parent af087df7af
commit 63ffcdd958
+2 -1
View File
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <metal/alloc.h>
#include <metal/errno.h>
#include <metal/log.h>
#include <metal/sys.h>
#include <sys/printk.h>
@@ -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);