Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 2015 11:30:39 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287426 - head/lib/libc/posix1e
Message-ID:  <201509031130.t83BUd2x006750@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu Sep  3 11:30:39 2015
New Revision: 287426
URL: https://svnweb.freebsd.org/changeset/base/287426

Log:
  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

Modified:
  head/lib/libc/posix1e/acl_init.c

Modified: head/lib/libc/posix1e/acl_init.c
==============================================================================
--- head/lib/libc/posix1e/acl_init.c	Thu Sep  3 07:18:52 2015	(r287425)
+++ head/lib/libc/posix1e/acl_init.c	Thu Sep  3 11:30:39 2015	(r287426)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509031130.t83BUd2x006750>