From 3e20706643c7709483fcd7d436e89090171fcc0f Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 6 Apr 2012 14:47:20 +0200 Subject: Fix error handling in TCP and IPC connecters Signed-off-by: Martin Sustrik --- src/ipc_connecter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ipc_connecter.cpp') diff --git a/src/ipc_connecter.cpp b/src/ipc_connecter.cpp index 4ed7b2f..ab2d872 100644 --- a/src/ipc_connecter.cpp +++ b/src/ipc_connecter.cpp @@ -66,8 +66,7 @@ xs::ipc_connecter_t::~ipc_connecter_t () handle = NULL; } - if (s != retired_fd) - close (); + close (); } void xs::ipc_connecter_t::process_plug () @@ -209,7 +208,9 @@ int xs::ipc_connecter_t::open () int xs::ipc_connecter_t::close () { - xs_assert (s != retired_fd); + if (s == retired_fd) + return 0; + int rc = ::close (s); if (rc != 0) return -1; -- cgit v1.2.3