Skip to content

Commit d627f7b

Browse files
authored
Use errno constants in emmalloc.c. NFC (#21092)
There is no reason to avoid using these constants in C code.
1 parent b1401d9 commit d627f7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

system/lib/emmalloc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
* we only declare the emalloc_* ones but not the standard ones.
4949
*/
5050

51+
#include <errno.h>
5152
#include <stdalign.h>
5253
#include <stdbool.h>
5354
#include <stddef.h>
@@ -1197,9 +1198,9 @@ int emmalloc_posix_memalign(void **memptr, size_t alignment, size_t size)
11971198
{
11981199
assert(memptr);
11991200
if (alignment % sizeof(void *) != 0)
1200-
return 22/* EINVAL*/;
1201+
return EINVAL;
12011202
*memptr = emmalloc_memalign(alignment, size);
1202-
return *memptr ? 0 : 12/*ENOMEM*/;
1203+
return *memptr ? 0 : ENOMEM;
12031204
}
12041205
EMMALLOC_ALIAS(posix_memalign, emmalloc_posix_memalign);
12051206

0 commit comments

Comments
 (0)