summaryrefslogtreecommitdiff
path: root/mmap/unix
diff options
context:
space:
mode:
authorjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2002-04-10 04:54:21 +0000
committerjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2002-04-10 04:54:21 +0000
commit4af722e09a1f7e2db252dfd7eb9fdd3978fb2bce (patch)
treed841493b9991733321006063c67b883c1f51cf99 /mmap/unix
parentd508a6cf36b0c7a82c6b67ce1c15403937497b95 (diff)
downloadlibapr-4af722e09a1f7e2db252dfd7eb9fdd3978fb2bce.tar.gz
Sanitize some return types.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63242 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'mmap/unix')
-rw-r--r--mmap/unix/mmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
index 21996add8..3f081308e 100644
--- a/mmap/unix/mmap.c
+++ b/mmap/unix/mmap.c
@@ -85,8 +85,10 @@ static apr_status_t mmap_cleanup(void *themmap)
apr_mmap_t *mm = themmap;
int rv;
- if ((!mm->is_owner) || (mm->mm == (void *)-1)) {
- /* XXX: we shouldn't ever get here */
+ if (!mm->is_owner) {
+ return APR_EINVAL;
+ }
+ else if (mm->mm == (void *)-1) {
return APR_ENOENT;
}
@@ -197,9 +199,9 @@ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap,
APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm)
{
- apr_status_t rv = APR_SUCCESS;
+ apr_status_t rv;
- if (mm->is_owner && ((rv = mmap_cleanup(mm)) == APR_SUCCESS)) {
+ if ((rv = mmap_cleanup(mm)) == APR_SUCCESS) {
apr_pool_cleanup_kill(mm->cntxt, mm, mmap_cleanup);
return APR_SUCCESS;
}