diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-04-02 22:59:54 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-04-02 22:59:54 -0700 |
commit | d791dcdbc49667257af79ca9329ba83d1b934b88 (patch) | |
tree | 7452581dd6c6af17a413b941140a632882aa6631 | |
parent | 24d64c8f580032a116d049c91d124ceebf306113 (diff) | |
download | pcu-d791dcdbc49667257af79ca9329ba83d1b934b88.tar.gz |
mincore: mmap() returns MAP_FAILED on failure
mmap() may return NULL on success in certain situations not applicable to us. The proper failure value is MAP_FAILED.
-rw-r--r-- | mincore.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |