From 81554346534ca5247d6852cbbf3f3df38c08bfa8 Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 3 Sep 2015 11:30:39 +0000 Subject: Fix the way acl_init(3) uses posix_memalign(3) - the latter doesn't set errno. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- lib/libc/posix1e/acl_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/posix1e/acl_init.c b/lib/libc/posix1e/acl_init.c index 4fe4037..88a1fc5 100644 --- a/lib/libc/posix1e/acl_init.c +++ b/lib/libc/posix1e/acl_init.c @@ -67,8 +67,10 @@ acl_init(int count) error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS, sizeof(struct acl_t_struct)); - if (error) + if (error) { + errno = error; return (NULL); + } bzero(acl, sizeof(struct acl_t_struct)); acl->ats_brand = ACL_BRAND_UNKNOWN; -- cgit v1.1