summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_set.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2010-06-03 14:29:17 +0000
committertrasz <trasz@FreeBSD.org>2010-06-03 14:29:17 +0000
commit307713b0cf837122c02128382f81fbe757863cb1 (patch)
tree52c585a6eb537ce710fd97e215843463b5f6f917 /lib/libc/posix1e/acl_set.c
parent26f044985faa2f6494d9f153cd2d95ed27c042d2 (diff)
downloadFreeBSD-src-307713b0cf837122c02128382f81fbe757863cb1.zip
FreeBSD-src-307713b0cf837122c02128382f81fbe757863cb1.tar.gz
_posix1e_acl_sort() never returns anything other than 0; change its
return type to void and update callers. This simplifies code and fixes one place where the returned value was not actually checked. Found with: Coverity Prevent CID: 4791
Diffstat (limited to 'lib/libc/posix1e/acl_set.c')
-rw-r--r--lib/libc/posix1e/acl_set.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/lib/libc/posix1e/acl_set.c b/lib/libc/posix1e/acl_set.c
index f9ee76d..fdc12b6 100644
--- a/lib/libc/posix1e/acl_set.c
+++ b/lib/libc/posix1e/acl_set.c
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
int
acl_set_file(const char *path_p, acl_type_t type, acl_t acl)
{
- int error;
if (acl == NULL || path_p == NULL) {
errno = EINVAL;
@@ -64,13 +63,8 @@ acl_set_file(const char *path_p, acl_type_t type, acl_t acl)
errno = EINVAL;
return (-1);
}
- if (_posix1e_acl(acl, type)) {
- error = _posix1e_acl_sort(acl);
- if (error) {
- errno = error;
- return (-1);
- }
- }
+ if (_posix1e_acl(acl, type))
+ _posix1e_acl_sort(acl);
acl->ats_cur_entry = 0;
@@ -80,7 +74,6 @@ acl_set_file(const char *path_p, acl_type_t type, acl_t acl)
int
acl_set_link_np(const char *path_p, acl_type_t type, acl_t acl)
{
- int error;
if (acl == NULL || path_p == NULL) {
errno = EINVAL;
@@ -91,13 +84,8 @@ acl_set_link_np(const char *path_p, acl_type_t type, acl_t acl)
errno = EINVAL;
return (-1);
}
- if (_posix1e_acl(acl, type)) {
- error = _posix1e_acl_sort(acl);
- if (error) {
- errno = error;
- return (-1);
- }
- }
+ if (_posix1e_acl(acl, type))
+ _posix1e_acl_sort(acl);
acl->ats_cur_entry = 0;
@@ -117,7 +105,6 @@ acl_set_fd(int fd, acl_t acl)
int
acl_set_fd_np(int fd, acl_t acl, acl_type_t type)
{
- int error;
if (acl == NULL) {
errno = EINVAL;
@@ -128,13 +115,8 @@ acl_set_fd_np(int fd, acl_t acl, acl_type_t type)
errno = EINVAL;
return (-1);
}
- if (_posix1e_acl(acl, type)) {
- error = _posix1e_acl_sort(acl);
- if (error) {
- errno = error;
- return (-1);
- }
- }
+ if (_posix1e_acl(acl, type))
+ _posix1e_acl_sort(acl);
acl->ats_cur_entry = 0;
OpenPOWER on IntegriCloud