Close some file descriptors on exec so that the inferior process gets
a normal environment. Fd's 3 and 4 were usually left open.
This commit is contained in:
parent
bd29cad15f
commit
27c62c22c7
@ -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)
|
||||
|
@ -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(). */
|
||||
|
Loading…
x
Reference in New Issue
Block a user