diff options
author | trasz <trasz@FreeBSD.org> | 2010-06-03 14:29:17 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2010-06-03 14:29:17 +0000 |
commit | 307713b0cf837122c02128382f81fbe757863cb1 (patch) | |
tree | 52c585a6eb537ce710fd97e215843463b5f6f917 /lib/libc/posix1e/acl_valid.c | |
parent | 26f044985faa2f6494d9f153cd2d95ed27c042d2 (diff) | |
download | FreeBSD-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_valid.c')
-rw-r--r-- | lib/libc/posix1e/acl_valid.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/lib/libc/posix1e/acl_valid.c b/lib/libc/posix1e/acl_valid.c index f345c01..d4cb872 100644 --- a/lib/libc/posix1e/acl_valid.c +++ b/lib/libc/posix1e/acl_valid.c @@ -79,20 +79,14 @@ acl_valid(acl_t acl) int acl_valid_file_np(const char *pathp, acl_type_t type, acl_t acl) { - int error; if (pathp == NULL || acl == NULL) { errno = EINVAL; return (-1); } type = _acl_type_unold(type); - 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); return (__acl_aclcheck_file(pathp, type, &acl->ats_acl)); } @@ -100,20 +94,14 @@ acl_valid_file_np(const char *pathp, acl_type_t type, acl_t acl) int acl_valid_link_np(const char *pathp, acl_type_t type, acl_t acl) { - int error; if (pathp == NULL || acl == NULL) { errno = EINVAL; return (-1); } type = _acl_type_unold(type); - 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); return (__acl_aclcheck_link(pathp, type, &acl->ats_acl)); } @@ -121,20 +109,14 @@ acl_valid_link_np(const char *pathp, acl_type_t type, acl_t acl) int acl_valid_fd_np(int fd, acl_type_t type, acl_t acl) { - int error; if (acl == NULL) { errno = EINVAL; return (-1); } type = _acl_type_unold(type); - 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; |