goto failure;
}
data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ close(fd);
if (data == (char *)-1) {
cc_log("Failed to mmap %s", path);
goto failure;
}
size = st.st_size;
data = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
+ close(fd);
if (data == (void *)-1) {
cc_log("Failed to mmap %s", path);
return 0;
}
- close(fd);
if (enable_direct) {
included_files = create_hashtable(1000, hash_from_string,
lines in preprocessor output. I have seen lines of over
100k in length, so this is well worth it */
map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ close(fd);
if (map == (char *)-1) {
cc_log("Failed to mmap %s", fname);
return -1;
}
- close(fd);
/* pass it through the unifier */
unify(hash, (unsigned char *)map, st.st_size);