From 24b02dc831889986211600a75572737e733ef9d8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 5 Mar 2008 14:53:25 +0000 Subject: - extracted logerror*() family of functions from syslogd, made them their own class and converted to new object calling conventions (interface-based) - converted gss-misc into a loadable library module --- plugins/imuxsock/imuxsock.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/imuxsock/imuxsock.c') diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 1be2e66f..68978231 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -39,6 +39,7 @@ #include "cfsysline.h" #include "module-template.h" #include "srUtils.h" +#include "errmsg.h" MODULE_TYPE_INPUT @@ -60,6 +61,7 @@ MODULE_TYPE_INPUT #endif /* Module static data */ DEF_IMOD_STATIC_DATA +DEFobjCurrIf(errmsg) static int startIndexUxLocalSockets; /* process funix from that index on (used to * suppress local logging. rgerhards 2005-08-01 @@ -142,7 +144,7 @@ static int create_unix_socket(const char *path) SUN_LEN(&sunx)) < 0 || chmod(path, 0666) < 0) { snprintf(line, sizeof(line), "cannot create %s", path); - logerror(line); + errmsg.LogError(NO_ERRCODE, "%s", line); dbgprintf("cannot create %s (%d).\n", path, errno); close(fd); return -1; @@ -169,7 +171,7 @@ static rsRetVal readSocket(int fd, int bParseHost) char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); dbgprintf("UNIX socket error: %d = %s.\n", errno, errStr); - logerror("recvfrom UNIX"); + errmsg.LogError(NO_ERRCODE, "recvfrom UNIX"); } RETiRet; @@ -300,6 +302,8 @@ BEGINmodInit() CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr + CHKiRet(objUse(errmsg, CORE_COMPONENT)); + /* initialize funixn[] array */ for(i = 1 ; i < MAXFUNIX ; ++i) { funixn[i] = NULL; -- cgit