mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-08 12:00:26 +00:00
Close some file descriptors that were left dangling before
This commit is contained in:
parent
b10b436ac9
commit
4a572b810b
@ -1151,10 +1151,7 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (indexst.st_size == 0) {
|
||||
continue; // no indices from this input
|
||||
}
|
||||
|
||||
if (indexst.st_size != 0) {
|
||||
struct index *indexmap = mmap(NULL, indexst.st_size, PROT_READ, MAP_PRIVATE, indexfds_in[i], 0);
|
||||
if (indexmap == MAP_FAILED) {
|
||||
fprintf(stderr, "fd %lld, len %lld\n", (long long) indexfds_in[i], (long long) indexst.st_size);
|
||||
@ -1203,6 +1200,7 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split
|
||||
perror("unmap geom");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (close(geomfds_in[i]) < 0) {
|
||||
perror("close geom");
|
||||
|
11
tile.cc
11
tile.cc
@ -1343,6 +1343,17 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *metabase, char *stringpo
|
||||
}
|
||||
}
|
||||
|
||||
int j;
|
||||
for (j = 0; j < TEMP_FILES; j++) {
|
||||
// Can be < 0 if there is only one source file, at z0
|
||||
if (geomfd[j] >= 0) {
|
||||
if (close(geomfd[j]) != 0) {
|
||||
perror("close geom");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!quiet) {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user