projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93815bc
)
Close file descriptors when execing network tap setup script, by
author
ths
<ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 19 Mar 2007 16:36:43 +0000
(16:36 +0000)
committer
ths
<ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 19 Mar 2007 16:36:43 +0000
(16:36 +0000)
Daniel P. Berrange.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2507
c046a42c
-6fe2-441c-8c8c-
71466251a162
vl.c
patch
|
blob
|
history
diff --git
a/vl.c
b/vl.c
index e77ed4124988fb4c6ddd87ed44afd24e07a300de..f368d9bba20b2242ef40545a25eef7fb08a3f449 100644
(file)
--- a/
vl.c
+++ b/
vl.c
@@
-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;