Fix where I was closing the prefilter pipe in the wrong thread

This commit is contained in:
Eric Fischer 2016-12-09 14:14:44 -08:00
parent c8a8915064
commit a338f5390f
3 changed files with 7 additions and 7 deletions

View File

@ -1367,6 +1367,10 @@ void *run_prefilter(void *v) {
layer_to_geojson(rpa->prefilter_fp, tmp_layer, 0, 0, 0, false, true);
}
if (fclose(rpa->prefilter_fp) != 0) {
perror("fclose output to prefilter");
exit(EXIT_FAILURE);
}
return NULL;
}
@ -1582,10 +1586,6 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
}
if (prefilter != NULL) {
if (fclose(prefilter_fp) != 0) {
perror("fclose output to prefilter");
exit(EXIT_FAILURE);
}
if (close(prefilter_read) != 0) {
perror("close output from prefilter");
exit(EXIT_FAILURE);

View File

@ -24,9 +24,9 @@ struct lonlat {
}
};
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y, bool comma, bool name) {
void layer_to_geojson(FILE *fp, mvt_layer const &layer, unsigned z, unsigned x, unsigned y, bool comma, bool name) {
for (size_t f = 0; f < layer.features.size(); f++) {
mvt_feature &feat = layer.features[f];
mvt_feature const &feat = layer.features[f];
if (comma && f != 0) {
fprintf(fp, ",\n");

View File

@ -1,2 +1,2 @@
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y, bool comma, bool name);
void layer_to_geojson(FILE *fp, mvt_layer const &layer, unsigned z, unsigned x, unsigned y, bool comma, bool name);
void fprintq(FILE *f, const char *s);