With this patch, calling the exit function from a remote console doesn't kill the socket but only the connection. This way, it will be possible to reconnect top the socket without having to restart opensm.
Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]> --- opensm/opensm/osm_console_io.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/opensm/opensm/osm_console_io.c b/opensm/opensm/osm_console_io.c index ce867bd..f0cbb8d 100644 --- a/opensm/opensm/osm_console_io.c +++ b/opensm/opensm/osm_console_io.c @@ -210,8 +210,16 @@ int osm_console_init(osm_subn_opt_t * opt, osm_console_t * p_oct, osm_log_t * p_ /* clean up and release resources */ void osm_console_exit(osm_console_t * p_oct, osm_log_t * p_log) { - // clean up and release resources, currently just close the socket - osm_console_close(p_oct, p_log); + + // currently just close the current connection, not the socket +#ifdef ENABLE_OSM_CONSOLE_SOCKET + if ((p_oct->socket > 0) && (p_oct->in_fd != -1)) { + OSM_LOG(p_log, OSM_LOG_INFO, + "Console connection closed: %s (%s)\n", + p_oct->client_hn, p_oct->client_ip); + cio_close(p_oct); + } +#endif } #ifdef ENABLE_OSM_CONSOLE_SOCKET -- 1.6.2-rc2.GIT _______________________________________________ general mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
