summaryrefslogtreecommitdiffstats
path: root/plugins/imklog/solaris.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-26 15:49:39 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-26 15:49:39 +0100
commit91a5e176d609d77d4451d7d7b1bf00dfdac5fe50 (patch)
treeea0cf9aa553ca5810ef78afb1bb26131dad2dc6a /plugins/imklog/solaris.c
parentee6ce30b474c033c71f5f5e9edf7941e29ea30b6 (diff)
downloadrsyslog-91a5e176d609d77d4451d7d7b1bf00dfdac5fe50.tar.gz
rsyslog-91a5e176d609d77d4451d7d7b1bf00dfdac5fe50.tar.xz
rsyslog-91a5e176d609d77d4451d7d7b1bf00dfdac5fe50.zip
added initial files for door support & fixed imklog
imklog now basically works, but needs quite some more work to do
Diffstat (limited to 'plugins/imklog/solaris.c')
-rw-r--r--plugins/imklog/solaris.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/plugins/imklog/solaris.c b/plugins/imklog/solaris.c
index 294efa7c..a0e85dc7 100644
--- a/plugins/imklog/solaris.c
+++ b/plugins/imklog/solaris.c
@@ -51,39 +51,6 @@ static int fklog; // TODO: remove
# define _PATH_KLOG "/dev/log"
#endif
-// HELPER
-/* handle some defines missing on more than one platform */
-#ifndef SUN_LEN
-#define SUN_LEN(su) \
- (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
-#endif
-
-int solaris_create_unix_socket(const char *path)
-{
- struct sockaddr_un sunx;
- int fd;
-
-return;
- if (path[0] == '\0')
- return -1;
-
- unlink(path);
-
- memset(&sunx, 0, sizeof(sunx));
- sunx.sun_family = AF_UNIX;
- (void) strncpy(sunx.sun_path, path, sizeof(sunx.sun_path));
- fd = socket(AF_UNIX, SOCK_DGRAM, 0);
- if (fd < 0 || bind(fd, (struct sockaddr *) &sunx, SUN_LEN(&sunx)) < 0 ||
- chmod(path, 0666) < 0) {
- //errmsg.LogError(errno, NO_ERRCODE, "connot create '%s'", path);
- dbgprintf("cannot create %s (%d).\n", path, errno);
- close(fd);
- return -1;
- }
- return fd;
-}
-// END HELPER
-
static uchar *GetPath(void)
{
@@ -104,7 +71,7 @@ klogWillRun(void)
int err = errno;
perror("XXX");
rs_strerror_r(err, errStr, sizeof(errStr));
- DBGPRINTF("error %d opening log socket %s: %s\n",
+ DBGPRINTF("error %d opening log socket: %s\n",
GetPath(), errStr);
iRet = RS_RET_ERR; // TODO: better error code
}