mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Keep from leaking other pipe file descriptors to unrelated children
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@@ -281,6 +282,14 @@ mvt_layer filter_layer(const char *filter, mvt_layer &layer, unsigned z, unsigne
|
|||||||
perror("close filter-side writer");
|
perror("close filter-side writer");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
if (fcntl(pipe_orig[1], F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
|
perror("cloxec output to filter");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
if (fcntl(pipe_filtered[0], F_SETFD, FD_CLOEXEC) != 0) {
|
||||||
|
perror("cloxec input from filter");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
if (pthread_mutex_unlock(&pipe_lock) != 0) {
|
if (pthread_mutex_unlock(&pipe_lock) != 0) {
|
||||||
perror("pthread_mutex_unlock (pipe_lock)");
|
perror("pthread_mutex_unlock (pipe_lock)");
|
||||||
|
|||||||
Reference in New Issue
Block a user