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
+1 -1
View File
@@ -78,7 +78,7 @@ void decode(char *fname, int z, unsigned x, unsigned y) {
int oz = z;
unsigned ox = x, oy = y;
int fd = open(fname, O_RDONLY);
int fd = open(fname, O_RDONLY | O_CLOEXEC);
if (fd >= 0) {
struct stat st;
if (fstat(fd, &st) == 0) {