MAP_FAILED, not NULL!
authorChip Black <bytex64@bytex64.net>
Wed, 2 Jul 2014 04:29:15 +0000 (23:29 -0500)
committerChip Black <bytex64@bytex64.net>
Wed, 2 Jul 2014 04:29:41 +0000 (23:29 -0500)
common/stringbucket.c

index 27c1023..7fd0bfa 100644 (file)
@@ -40,7 +40,7 @@ struct stringbucket * stringbucket_open(const char *filename) {
        flock(obj->fd, LOCK_UN);
        obj->size = st.st_size;
        obj->list = mmap(NULL, obj->size, PROT_READ | PROT_WRITE, MAP_SHARED, obj->fd, 0);
-       if (obj->list == NULL) {
+       if (obj->list == MAP_FAILED) {
                perror("stringbucket mmap");
                close(obj->fd);
                free(obj);