Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/httpd compare mmap return again MAP_FAILED not -1 or 0.



details:   https://anonhg.NetBSD.org/src/rev/871cae68f204
branches:  trunk
changeset: 942795:871cae68f204
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Aug 20 07:56:26 2020 +0000

description:
compare mmap return again MAP_FAILED not -1 or 0.

diffstat:

 libexec/httpd/bozohttpd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r a22f3b5e544c -r 871cae68f204 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Thu Aug 20 07:55:10 2020 +0000
+++ b/libexec/httpd/bozohttpd.c Thu Aug 20 07:56:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bozohttpd.c,v 1.118 2020/08/20 05:46:31 spz Exp $      */
+/*     $NetBSD: bozohttpd.c,v 1.119 2020/08/20 07:56:26 mrg Exp $      */
 
 /*     $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $      */
 
@@ -914,7 +914,7 @@
        wroffset = (size_t)(first_byte_pos - mappedoffset);
 
        addr = mmap(0, mappedsz, PROT_READ, MAP_SHARED, fd, mappedoffset);
-       if (addr == (char *)-1) {
+       if (addr == MAP_FAILED) {
                bozowarn(httpd, "mmap failed: %s", strerror(errno));
                return -1;
        }
@@ -1201,7 +1201,7 @@
        }
 
        fmap = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, mapfile, 0);
-       if (fmap == NULL) {
+       if (fmap == MAP_FAILED) {
                bozowarn(httpd, "could not mmap " REMAP_FILE ", error %d",
                    errno);
                goto out;



Home | Main Index | Thread Index | Old Index