Commit c7afc80b authored by unknown's avatar unknown

make sure we handle a failure case in connect_mgmd correctly


ndb/src/common/transporter/TransporterRegistry.cpp:
  make sure we handle a failure case in connect_mgmd correctly
ndb/src/mgmapi/mgmapi.cpp:
  return NDB_INVALID_SOCKET at failure
parent a5553ee8
......@@ -1458,12 +1458,7 @@ TransporterRegistry::startReceiving()
DBUG_PRINT("error",("Install failed"));
g_eventLogger.error("Failed to install signal handler for"
" SHM transporter errno: %d (%s)", errno,
#ifdef HAVE_STRERROR
strerror(errno)
#else
""
#endif
);
strerror(errno));
}
}
#endif // NDB_SHM_TRANSPORTER
......@@ -1578,7 +1573,11 @@ NDB_SOCKET_TYPE TransporterRegistry::connect_ndb_mgmd(SocketClient *sc)
ndb_mgm_destroy_handle(&h);
return NDB_INVALID_SOCKET;
}
return ndb_mgm_convert_to_transporter(h);
NDB_SOCKET_TYPE sockfd= ndb_mgm_convert_to_transporter(h);
if ( sockfd == NDB_INVALID_SOCKET)
ndb_mgm_destroy_handle(&h);
return sockfd;
}
template class Vector<TransporterRegistry::Transporter_interface>;
......@@ -2184,8 +2184,8 @@ ndb_mgm_convert_to_transporter(NdbMgmHandle handle)
{
NDB_SOCKET_TYPE s;
CHECK_HANDLE(handle, -1);
CHECK_CONNECTED(handle, -2);
CHECK_HANDLE(handle, NDB_INVALID_SOCKET);
CHECK_CONNECTED(handle, NDB_INVALID_SOCKET);
handle->connected= 0; // we pretend we're disconnected
s= handle->socket;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment