Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2008 15:39:56 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 148852 for review
Message-ID:  <200808301539.m7UFduCZ052708@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=148852

Change 148852 by trasz@trasz_traszkan on 2008/08/30 15:39:16

	Remove all the err(3) calls from libc/posix1e/acl_strip.c.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_strip.c#6 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_strip.c#6 (text+ko) ====

@@ -24,8 +24,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* XXX: remove all the err(3) calls. */
-#include <err.h>
 #include <errno.h>
 #include <stdio.h>
 #include <assert.h>
@@ -74,14 +72,14 @@
 
 	acl_old = acl_dup(aclp);
 	if (acl_old == NULL)
-		err(1, "acl_dup() failed");
+		return (NULL);
 
 	assert(_acl_brand(acl_old) == ACL_BRAND_POSIX);
 
 	have_mask_entry = 0;
 	acl_new = acl_init(ACL_MAX_ENTRIES);
 	if (acl_new == NULL)
-		err(1, "acl_init() failed");
+		return (NULL);
 	tag = ACL_UNDEFINED_TAG;
 
 	/* only save the default user/group/other entries */
@@ -92,24 +90,24 @@
 		assert(_entry_brand(entry) == ACL_BRAND_POSIX);
 
 		if (acl_get_tag_type(entry, &tag) == -1)
-			err(1, "acl_get_tag_type() failed");
+			return (NULL);
 
 		switch(tag) {
 		case ACL_USER_OBJ:
 		case ACL_GROUP_OBJ:
 		case ACL_OTHER:
 			if (acl_get_tag_type(entry, &tag) == -1)
-				err(1, "acl_get_tag_type() failed");
+				return (NULL);
 			if (acl_get_permset(entry, &perm) == -1)
-				err(1, "acl_get_permset() failed");
+				return (NULL);
 			if (acl_create_entry(&acl_new, &entry_new) == -1)
-				err(1, "acl_create_entry() failed");
+				return (NULL);
 			if (acl_set_tag_type(entry_new, tag) == -1)
-				err(1, "acl_set_tag_type() failed");
+				return (NULL);
 			if (acl_set_permset(entry_new, perm) == -1)
-				err(1, "acl_get_permset() failed");
+				return (NULL);
 			if (acl_copy_entry(entry_new, entry) == -1)
-				err(1, "acl_copy_entry() failed");
+				return (NULL);
 			assert(_entry_brand(entry_new) == ACL_BRAND_POSIX);
 			break;
 		case ACL_MASK:
@@ -124,7 +122,7 @@
 
 	if (have_mask_entry && recalculate_mask) {
 		if (acl_calc_mask(&acl_new) == -1)
-			err(1, "acl_calc_mask() failed");
+			return (NULL);
 	}
 
 	return (acl_new);



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