- char errbuf[1024];
- ERROR("unixsock plugin: socket failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (-1);
+ ERROR("unixsock plugin: socket failed: %s", STRERRNO);
+ return -1;
} else if (status == 0) {
INFO("unixsock plugin: Successfully deleted socket file \"%s\".",
sa.sun_path);
} else if (status == 0) {
INFO("unixsock plugin: Successfully deleted socket file \"%s\".",
sa.sun_path);
- char errbuf[1024];
- sstrerror(errno, errbuf, sizeof(errbuf));
- ERROR("unixsock plugin: bind failed: %s", errbuf);
+ ERROR("unixsock plugin: bind failed: %s", STRERRNO);
- char errbuf[1024];
- ERROR("unixsock plugin: chmod failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: chmod failed: %s", STRERRNO);
- char errbuf[1024];
- ERROR("unixsock plugin: listen failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: listen failed: %s", STRERRNO);
status = getgrnam_r(grpname, &sg, grbuf, sizeof(grbuf), &g);
if (status != 0) {
status = getgrnam_r(grpname, &sg, grbuf, sizeof(grbuf), &g);
if (status != 0) {
WARNING("unixsock plugin: chown (%s, -1, %i) failed: %s",
(sock_file != NULL) ? sock_file : US_DEFAULT_PATH, (int)g->gr_gid,
WARNING("unixsock plugin: chown (%s, -1, %i) failed: %s",
(sock_file != NULL) ? sock_file : US_DEFAULT_PATH, (int)g->gr_gid,
- char errbuf[1024];
- ERROR("unixsock plugin: dup failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: dup failed: %s", STRERRNO);
- char errbuf[1024];
- ERROR("unixsock plugin: fdopen failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: fdopen failed: %s", STRERRNO);
- char errbuf[1024];
- ERROR("unixsock plugin: fdopen failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: fdopen failed: %s", STRERRNO);
}
/* change output buffer to line buffered mode */
if (setvbuf(fhout, NULL, _IOLBF, 0) != 0) {
}
/* change output buffer to line buffered mode */
if (setvbuf(fhout, NULL, _IOLBF, 0) != 0) {
- char errbuf[1024];
- ERROR("unixsock plugin: setvbuf failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: setvbuf failed: %s", STRERRNO);
} else if (strcasecmp(fields[0], "getthreshold") == 0) {
handle_getthreshold(fhout, buffer);
} else if (strcasecmp(fields[0], "putval") == 0) {
} else if (strcasecmp(fields[0], "getthreshold") == 0) {
handle_getthreshold(fhout, buffer);
} else if (strcasecmp(fields[0], "putval") == 0) {
} else if (strcasecmp(fields[0], "putnotif") == 0) {
handle_putnotif(fhout, buffer);
} else if (strcasecmp(fields[0], "flush") == 0) {
} else if (strcasecmp(fields[0], "putnotif") == 0) {
handle_putnotif(fhout, buffer);
} else if (strcasecmp(fields[0], "flush") == 0) {
DEBUG("unixsock plugin: Calling accept..");
status = accept(sock_fd, NULL, NULL);
if (status < 0) {
DEBUG("unixsock plugin: Calling accept..");
status = accept(sock_fd, NULL, NULL);
if (status < 0) {
- ERROR("unixsock plugin: accept failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("unixsock plugin: accept failed: %s", STRERRNO);
- char errbuf[1024];
- WARNING("unixsock plugin: malloc failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("unixsock plugin: malloc failed: %s", STRERRNO);
DEBUG("Spawning child to handle connection on fd #%i", *remote_fd);
status = plugin_thread_create(&th, &th_attr, us_handle_client,
DEBUG("Spawning child to handle connection on fd #%i", *remote_fd);
status = plugin_thread_create(&th, &th_attr, us_handle_client,
- char errbuf[1024];
- WARNING("unixsock plugin: pthread_create failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("unixsock plugin: pthread_create failed: %s", STRERRNO);
- (sock_file != NULL) ? sock_file : US_DEFAULT_PATH,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ (sock_file != NULL) ? sock_file : US_DEFAULT_PATH, STRERRNO);
} /* void *us_server_thread */
static int us_config(const char *key, const char *val) {
if (strcasecmp(key, "SocketFile") == 0) {
char *new_sock_file = strdup(val);
if (new_sock_file == NULL)
} /* void *us_server_thread */
static int us_config(const char *key, const char *val) {
if (strcasecmp(key, "SocketFile") == 0) {
char *new_sock_file = strdup(val);
if (new_sock_file == NULL)
sfree(sock_file);
sock_file = new_sock_file;
} else if (strcasecmp(key, "SocketGroup") == 0) {
char *new_sock_group = strdup(val);
if (new_sock_group == NULL)
sfree(sock_file);
sock_file = new_sock_file;
} else if (strcasecmp(key, "SocketGroup") == 0) {
char *new_sock_group = strdup(val);
if (new_sock_group == NULL)
sock_perms = (int)strtol(val, NULL, 8);
} else if (strcasecmp(key, "DeleteSocket") == 0) {
if (IS_TRUE(val))
sock_perms = (int)strtol(val, NULL, 8);
} else if (strcasecmp(key, "DeleteSocket") == 0) {
if (IS_TRUE(val))
- status = plugin_thread_create(&listen_thread, NULL, us_server_thread, NULL);
+ status = plugin_thread_create(&listen_thread, NULL, us_server_thread, NULL,
+ "unixsock listen");
- char errbuf[1024];
- ERROR("unixsock plugin: pthread_create failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (-1);
+ ERROR("unixsock plugin: pthread_create failed: %s", STRERRNO);
+ return -1;
plugin_register_init("unixsock", us_init);
plugin_register_shutdown("unixsock", us_shutdown);
} /* void module_register (void) */
plugin_register_init("unixsock", us_init);
plugin_register_shutdown("unixsock", us_shutdown);
} /* void module_register (void) */