Set close-on-exec flag for most file descriptors

This commit is contained in:
Eric Fischer
2016-12-07 10:57:56 -08:00
parent 7514797c4c
commit 87d86ecfc9
4 changed files with 51 additions and 28 deletions
+2 -1
View File
@@ -20,6 +20,7 @@
#include <pthread.h>
#include <errno.h>
#include <time.h>
#include <fcntl.h>
#include "mvt.hpp"
#include "mbtiles.hpp"
#include "geometry.hpp"
@@ -2067,7 +2068,7 @@ int traverse_zooms(int *geomfd, off_t *geom_size, char *metabase, char *stringpo
perror(geomname);
exit(EXIT_FAILURE);
}
sub[j] = fopen(geomname, "wb");
sub[j] = fopen_oflag(geomname, "wb", O_WRONLY | O_CLOEXEC);
if (sub[j] == NULL) {
perror(geomname);
exit(EXIT_FAILURE);