diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-05 14:53:25 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-03-05 14:53:25 +0000 |
commit | 24b02dc831889986211600a75572737e733ef9d8 (patch) | |
tree | 50e1525e5749c8b6e51969d8ff88060a172b0497 /plugins/imuxsock | |
parent | 213e0b596205626214891fb46e1a780af7f26a8b (diff) | |
download | rsyslog-24b02dc831889986211600a75572737e733ef9d8.tar.gz rsyslog-24b02dc831889986211600a75572737e733ef9d8.tar.xz rsyslog-24b02dc831889986211600a75572737e733ef9d8.zip |
- 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
Diffstat (limited to 'plugins/imuxsock')
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; |