ssa_log.c: Set flog pointer to NULL after fclose in ssa_close_log

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa_log.c: Avoid closing stderr or stdout in ssa_close_log

SSA may use stderr or stdout for log. If an application
uses stderr or stdout after, this will likely crash the application
in unexpected way.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
[core distrib acm]: Move ssa log closing after cleanup

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Revert "plugin/configure.ac: Removed no longer needed glib check"

This reverts commit 5bcf3b8ef987fa78aad295abd4ae32fdfbe681a2

glib is now needed (again).

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
[acm distrib]/configure.in: Add Glib checking to ibacm and ibssa applications

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
[plugin distrib acm]/configure: Add check for g_thread_init function

AC_CHECK_LIB adds to dependencies necessary for g_thread_init.
The function's dependency is different from other Glib
threading routines.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
[plugin distrib acm]/Makefile.am: Add Glib support to Makefiles

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Initialize the Glib thread subsystem.
ssa.c: Create Glib pthread pool for rclose.
ssa.c: Add logging to g_rclose_callback
ssa.c: Push rclose to thread pool
ssa.c: Report in ssa_cleanup number of rsocket waiting for close.
ssa.c: Call g_thread_init only if Glib ver < 2.32

 From : https://developer.gnome.org/glib/stable/glib-Deprecated-Thread-APIs.html#g-thread-init

 g_thread_init has been deprecated since version 2.32 and should
 not be used in newly-written code. This function is no longer necessary.
 The GLib threading system is automatically initialized
 at the start of your program.