return LB_STATUS_ERROR_ALREADY;
}
+ /*!
+ * \note
+ * getenv is not safe in the threads.
+ */
option = getenv("PROVIDER_DISABLE_PREVENT_OVERWRITE");
if (option && !strcasecmp(option, "true")) {
s_info.prevent_overwrite = 1;
EAPI void *provider_fini(void)
{
void *ret;
+ static int provider_fini_called = 0;
+
+ if (provider_fini_called) {
+ ErrPrint("Provider finalize is already called\n");
+ return NULL;
+ }
if (!s_info.name) {
ErrPrint("Connection is not established (or cleared already)\n");
return NULL;
}
+ provider_fini_called = 1;
+
if (s_info.fd >= 0) {
com_core_packet_client_fini(s_info.fd);
s_info.fd = -1;
}
+ provider_fini_called = 0;
+
com_core_del_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
com_core_del_event_callback(CONNECTOR_CONNECTED, connected_cb, NULL);
ret = s_info.data;
s_info.data = NULL;
+
return ret;
}