static YAZ_MUTEX g_mutex = 0;
static int no_connections = 0;
static int total_no_connections = 0;
-static void connection_use(int delta)
+
+static int connection_use(int delta)
{
int result;
if (!g_mutex)
yaz_mutex_create(&g_mutex);
yaz_mutex_enter(g_mutex);
no_connections += delta;
- result = no_connection;
+ result = no_connections;
if (delta > 0)
total_no_connections += delta;
yaz_mutex_leave(g_mutex);
no_iochans += delta;
if (delta > 0)
no_iochans_total += delta;
- iochans = no_clients;
+ iochans = no_iochans;
yaz_mutex_leave(g_mutex);
yaz_log(YLOG_DEBUG, "%s iochans=%d", delta == 0 ? "" : (delta > 0 ? "INC" : "DEC"), iochans);
return iochans;
for (nextp = iochans; *nextp;) {
IOCHAN p = *nextp;
if (p->destroyed && p->thread_users == 0) {
- *nextp = iochan_destroy_real(iochan);
+ *nextp = iochan_destroy_real(nextp);
} else
nextp = &p->next;
}
#include "settings.h"
#include "client.h"
+#ifdef __LINUX__
#include <malloc.h>
-
void print_meminfo(WRBUF wrbuf) {
-#ifdef __GNUC__
struct mallinfo minfo;
minfo = mallinfo();
wrbuf_printf(wrbuf, " <memory>\n"
" </memory>\n",
minfo.arena, minfo.uordblks, minfo.fordblks,minfo.ordblks, minfo.keepcost, minfo.hblks, minfo.hblkhd, minfo.arena + minfo.hblkhd, minfo.uordblks + minfo.hblkhd);
-#endif
}
+#else
+#define print_meminfo(x)
+#endif
// Update this when the protocol changes