diff options
author | bde <bde@FreeBSD.org> | 1997-12-17 13:23:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-12-17 13:23:51 +0000 |
commit | a3800989c11caa7f22124276aee991f67f91098c (patch) | |
tree | b10094dfb7a53e29e132cb14d55ccad12c4bb1f0 /contrib/gdb | |
parent | f2787bdeb2f7f44a49a49b6e60e726a33b5dfbdd (diff) | |
download | FreeBSD-src-a3800989c11caa7f22124276aee991f67f91098c.zip FreeBSD-src-a3800989c11caa7f22124276aee991f67f91098c.tar.gz |
Close some file descriptors on exec so that the inferior process gets
a normal environment. Fd's 3 and 4 were usually left open.
Diffstat (limited to 'contrib/gdb')
-rw-r--r-- | contrib/gdb/gdb/exec.c | 1 | ||||
-rw-r--r-- | contrib/gdb/gdb/symfile.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/contrib/gdb/gdb/exec.c b/contrib/gdb/gdb/exec.c index dc71a49..4d3a307 100644 --- a/contrib/gdb/gdb/exec.c +++ b/contrib/gdb/gdb/exec.c @@ -185,6 +185,7 @@ exec_file_command (args, from_tty) &scratch_pathname); if (scratch_chan < 0) perror_with_name (filename); + fcntl (scratch_chan, F_SETFD, 1); exec_bfd = bfd_fdopenr (scratch_pathname, gnutarget, scratch_chan); if (!exec_bfd) diff --git a/contrib/gdb/gdb/symfile.c b/contrib/gdb/gdb/symfile.c index 62c4f61..4604678 100644 --- a/contrib/gdb/gdb/symfile.c +++ b/contrib/gdb/gdb/symfile.c @@ -820,6 +820,7 @@ symfile_bfd_open (name) make_cleanup (free, name); perror_with_name (name); } + fcntl (desc, F_SETFD, 1); free (name); /* Free 1st new malloc'd copy */ name = absolute_name; /* Keep 2nd malloc'd copy in bfd */ /* It'll be freed in free_objfile(). */ |