about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--mincore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mincore.c b/mincore.c
index 3314d3c..4bdbd0c 100644
--- a/mincore.c
+++ b/mincore.c
@@ -45,7 +45,7 @@ static void mincore_stats(const char *path, off_t offset, off_t len)
         map_offset = PAGE_ALIGN_DOWN(offset + 1);
 
         map = mmap(NULL, map_len, PROT_READ, MAP_SHARED, fd, map_offset);
-        if (!map) {
+        if (map == MAP_FAILED) {
                 fprintf(stderr, "%s: mmap(%lu): %s\n",
                         path, (unsigned long)vec_len, strerror(errno));
                 goto err_free;