summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-10-15 12:17:03 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-15 12:17:03 +0200
commit6fb9b4ec24ea258b29c45c8969daaa063937d515 (patch)
tree262ea255084cde32d687821f20401fc366245350
parentbdff443eda604cf38f32c2760f4fb5d01ba1d920 (diff)
downloadneard-6fb9b4ec24ea258b29c45c8969daaa063937d515.tar.gz
neard-6fb9b4ec24ea258b29c45c8969daaa063937d515.tar.bz2
neard-6fb9b4ec24ea258b29c45c8969daaa063937d515.zip
p2p: Close a created socket if it's already bound
-rw-r--r--plugins/p2p.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/p2p.c b/plugins/p2p.c
index 7730bcb..a7236ea 100644
--- a/plugins/p2p.c
+++ b/plugins/p2p.c
@@ -229,6 +229,7 @@ static int p2p_bind(struct near_p2p_driver *driver, uint32_t adapter_idx,
if (err < 0) {
if (errno == EADDRINUSE) {
DBG("%s is already bound", driver->name);
+ close(fd);
return 0;
}