From: Gonglei Date: Fri, 31 Oct 2014 06:11:00 +0000 (+0800) Subject: tap: do not close(fd) in net_init_tap_one X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~209^2~493^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0caa3eb539de01043354440ce0a10b1f546cf06;p=sdk%2Femulator%2Fqemu.git tap: do not close(fd) in net_init_tap_one commit 5193e5fb (tap: factor out common tap initialization) introduce net_init_tap_one(). But it's inappropriate that we close fd in net_init_tap_one(), we should lay it in the caller, becuase some callers needn't to close it if we get the fd by monitor_handle_fd_param(). On the other hand, in other exceptional branches fd isn't closed, so that's incomplete anyway. Signed-off-by: Gonglei Signed-off-by: Michael Tokarev --- diff --git a/net/tap.c b/net/tap.c index a40f7f023f..7bcd4c73ea 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; }