qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PATCH 1/2] tap: remove close(fd)


From: arei.gonglei
Subject: [Qemu-trivial] [PATCH 1/2] tap: remove close(fd)
Date: Fri, 31 Oct 2014 14:11:00 +0800

From: Gonglei <address@hidden>

commit 5193e5fb (tap: factor out common tap initialization)
introduce net_init_tap_one(). But it's inapposite that close
fd in net_init_tap_one(), we should lay it in the caller,
becuase some caller needn't to close it if we get the fd
by monitor_handle_fd_param().

On the other hand, in other exceptional branch fd doesn't
be closed, so that's incomplete.

Signed-off-by: Gonglei <address@hidden>
---
 net/tap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/tap.c b/net/tap.c
index a40f7f0..7bcd4c7 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -598,7 +598,6 @@ static int net_init_tap_one(const NetdevTapOptions *tap, 
NetClientState *peer,
 
     s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
     if (!s) {
-        close(fd);
         return -1;
     }
 
-- 
1.7.12.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]