Merge branch 'development'
[NeonServV5.git] / src / IRCEvents.c
index 83428c9b31390cbd0853feafb749298ce21d0c6e..2eea34d8ecc1067bddf693e2a721b6a748abeee7 100644 (file)
@@ -21,6 +21,7 @@
 #include "ChanUser.h"
 #include "ClientSocket.h"
 #include "mysqlConn.h"
+#include "log.h"
 
 struct binding {
     void *func;
@@ -105,7 +106,7 @@ int bind_##NAME(FUNCTYPE *func, int module_id) { \
     if(!is_bound(TYPE, func)) { \
         struct binding *cbind = malloc(sizeof(*cbind)); \
         if (!cbind) { \
-            perror("malloc() failed"); \
+            printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__); \
             return 0; \
         } \
         cbind->func = func; \
@@ -233,4 +234,4 @@ FUNC_EVENT(reload, reload_func_t, BIND_TYPE_RELOAD, (int initialization), (initi
 
 FUNC_BIND(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT)
 FUNC_UNBIND(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT)
-FUNC_EVENT(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT, (struct ClientNode *client), (client))
+FUNC_EVENT(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT, (struct ClientSocket *client), (client))