diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-10 17:01:00 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-10 17:01:00 +0000 |
commit | 21ff46861c35d99dbbafc42d0854128270ef8f30 (patch) | |
tree | 695d5c1355aa6d9a74417ee617656c18be640b79 /gdb/inf-ttrace.c | |
parent | d3685d60d601f0ae817beb920fc1156f1f0885ee (diff) | |
download | gdb-21ff46861c35d99dbbafc42d0854128270ef8f30.zip gdb-21ff46861c35d99dbbafc42d0854128270ef8f30.tar.gz gdb-21ff46861c35d99dbbafc42d0854128270ef8f30.tar.bz2 |
2013-05-10 Joel Brobecker <brobecker@adacore.com>
Tom Tromey <tromey@redhat.com>
* common/filestuff.c (mark_fd_no_cloexec, unmark_fd_no_cloexec):
New functions.
* common/filestuff.c (mark_fd_no_cloexec, unmark_fd_no_cloexec):
Declare.
* darwin-nat.c (darwin_pre_ptrace): Use mark_fd_no_cloexec.
(darwin_ptrace_him): Use unmark_fd_no_cloexec.
* inf-ttrace.c (do_cleanup_pfds): Use unmark_fd_no_cloexec.
(inf_ttrace_prepare): Use mark_fd_no_cloexec.
Diffstat (limited to 'gdb/inf-ttrace.c')
-rw-r--r-- | gdb/inf-ttrace.c | 11 |
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. */ |