o When returning NULL, return (NULL) instead of return (0).
Submitted by: jedgar Obtained from: TrustedBSD Project
This commit is contained in:
parent
324fffaed1
commit
f0078215b7
@ -118,12 +118,12 @@ acl_from_text(const char *buf_p)
|
||||
/* Local copy we can mess up. */
|
||||
mybuf_p = strdup(buf_p);
|
||||
if (!mybuf_p)
|
||||
return(0);
|
||||
return(NULL);
|
||||
|
||||
acl = acl_init(3);
|
||||
if (!acl) {
|
||||
free(mybuf_p);
|
||||
return(0);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Outer loop: delimit at \n boundaries. */
|
||||
@ -223,7 +223,7 @@ acl_from_text(const char *buf_p)
|
||||
error_label:
|
||||
acl_free(acl);
|
||||
free(mybuf_p);
|
||||
return(0);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,13 +44,13 @@ acl_get_file(const char *path_p, acl_type_t type)
|
||||
|
||||
aclp = acl_init(ACL_MAX_ENTRIES);
|
||||
if (!aclp) {
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
error = __acl_get_file(path_p, type, aclp);
|
||||
if (error) {
|
||||
acl_free(aclp);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (aclp);
|
||||
@ -64,13 +64,13 @@ acl_get_fd(int fd)
|
||||
|
||||
aclp = acl_init(ACL_MAX_ENTRIES);
|
||||
if (!aclp) {
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
error = __acl_get_fd(fd, ACL_TYPE_ACCESS, aclp);
|
||||
if (error) {
|
||||
acl_free(aclp);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (aclp);
|
||||
@ -84,13 +84,13 @@ acl_get_fd_np(int fd, acl_type_t type)
|
||||
|
||||
aclp = acl_init(ACL_MAX_ENTRIES);
|
||||
if (!aclp) {
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
error = __acl_get_fd(fd, type, aclp);
|
||||
if (error) {
|
||||
acl_free(aclp);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (aclp);
|
||||
|
@ -43,7 +43,7 @@ acl_init(int count)
|
||||
|
||||
if (count > ACL_MAX_ENTRIES) {
|
||||
errno = ENOMEM;
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
acl = (struct acl *) malloc(sizeof(struct acl));
|
||||
|
@ -61,7 +61,7 @@ acl_to_text(acl_t acl, ssize_t *len_p)
|
||||
|
||||
buf = strdup("");
|
||||
if (!buf)
|
||||
return(0);
|
||||
return(NULL);
|
||||
|
||||
mask_perm = ACL_PERM_BITS; /* effective is regular if no mask */
|
||||
for (i = 0; i < acl->acl_cnt; i++)
|
||||
@ -218,5 +218,5 @@ acl_to_text(acl_t acl, ssize_t *len_p)
|
||||
error_label:
|
||||
/* jump to here sets errno already, we just clean up */
|
||||
if (buf) free(buf);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
@ -118,12 +118,12 @@ acl_from_text(const char *buf_p)
|
||||
/* Local copy we can mess up. */
|
||||
mybuf_p = strdup(buf_p);
|
||||
if (!mybuf_p)
|
||||
return(0);
|
||||
return(NULL);
|
||||
|
||||
acl = acl_init(3);
|
||||
if (!acl) {
|
||||
free(mybuf_p);
|
||||
return(0);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Outer loop: delimit at \n boundaries. */
|
||||
@ -223,7 +223,7 @@ acl_from_text(const char *buf_p)
|
||||
error_label:
|
||||
acl_free(acl);
|
||||
free(mybuf_p);
|
||||
return(0);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,13 +44,13 @@ acl_get_file(const char *path_p, acl_type_t type)
|
||||
|
||||
aclp = acl_init(ACL_MAX_ENTRIES);
|
||||
if (!aclp) {
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
error = __acl_get_file(path_p, type, aclp);
|
||||
if (error) {
|
||||
acl_free(aclp);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (aclp);
|
||||
@ -64,13 +64,13 @@ acl_get_fd(int fd)
|
||||
|
||||
aclp = acl_init(ACL_MAX_ENTRIES);
|
||||
if (!aclp) {
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
error = __acl_get_fd(fd, ACL_TYPE_ACCESS, aclp);
|
||||
if (error) {
|
||||
acl_free(aclp);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (aclp);
|
||||
@ -84,13 +84,13 @@ acl_get_fd_np(int fd, acl_type_t type)
|
||||
|
||||
aclp = acl_init(ACL_MAX_ENTRIES);
|
||||
if (!aclp) {
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
error = __acl_get_fd(fd, type, aclp);
|
||||
if (error) {
|
||||
acl_free(aclp);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (aclp);
|
||||
|
@ -43,7 +43,7 @@ acl_init(int count)
|
||||
|
||||
if (count > ACL_MAX_ENTRIES) {
|
||||
errno = ENOMEM;
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
acl = (struct acl *) malloc(sizeof(struct acl));
|
||||
|
@ -61,7 +61,7 @@ acl_to_text(acl_t acl, ssize_t *len_p)
|
||||
|
||||
buf = strdup("");
|
||||
if (!buf)
|
||||
return(0);
|
||||
return(NULL);
|
||||
|
||||
mask_perm = ACL_PERM_BITS; /* effective is regular if no mask */
|
||||
for (i = 0; i < acl->acl_cnt; i++)
|
||||
@ -218,5 +218,5 @@ acl_to_text(acl_t acl, ssize_t *len_p)
|
||||
error_label:
|
||||
/* jump to here sets errno already, we just clean up */
|
||||
if (buf) free(buf);
|
||||
return (0);
|
||||
return (NULL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user