aboutsummaryrefslogtreecommitdiff
path: root/gdb/inf-ttrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/inf-ttrace.c')
-rw-r--r--gdb/inf-ttrace.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index 642e520..511a67c 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -38,6 +38,7 @@
#include "inf-child.h"
#include "inf-ttrace.h"
+#include "common/filestuff.h"
@@ -558,6 +559,11 @@ do_cleanup_pfds (void *dummy)
close (inf_ttrace_pfd1[1]);
close (inf_ttrace_pfd2[0]);
close (inf_ttrace_pfd2[1]);
+
+ unmark_fd_no_cloexec (inf_ttrace_pfd1[0]);
+ unmark_fd_no_cloexec (inf_ttrace_pfd1[1]);
+ unmark_fd_no_cloexec (inf_ttrace_pfd2[0]);
+ unmark_fd_no_cloexec (inf_ttrace_pfd2[1]);
}
static void
@@ -572,6 +578,11 @@ inf_ttrace_prepare (void)
close (inf_ttrace_pfd2[0]);
perror_with_name (("pipe"));
}
+
+ mark_fd_no_cloexec (inf_ttrace_pfd1[0]);
+ mark_fd_no_cloexec (inf_ttrace_pfd1[1]);
+ mark_fd_no_cloexec (inf_ttrace_pfd2[0]);
+ mark_fd_no_cloexec (inf_ttrace_pfd2[1]);
}
/* Prepare to be traced. */