sim-card
/
qemu
Archived
10
0
Fork 0

Close file descriptors when execing network tap setup script, by

Daniel P. Berrange.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2507 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2007-03-19 16:36:43 +00:00
parent 93815bc280
commit 50d3eeae38
1 changed files with 8 additions and 0 deletions

8
vl.c
View File

@ -3621,6 +3621,14 @@ static int net_tap_init(VLANState *vlan, const char *ifname1,
pid = fork();
if (pid >= 0) {
if (pid == 0) {
int open_max = sysconf (_SC_OPEN_MAX), i;
for (i = 0; i < open_max; i++)
if (i != STDIN_FILENO &&
i != STDOUT_FILENO &&
i != STDERR_FILENO &&
i != fd)
close(i);
parg = args;
*parg++ = (char *)setup_script;
*parg++ = ifname;