char errbuf[1024];
ERROR("unixsock plugin: socket failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
char errbuf[1024];
ERROR("unixsock plugin: socket failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
} 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("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,
} /* 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)
- status = plugin_thread_create(&listen_thread, NULL, us_server_thread, NULL);
+ status = plugin_thread_create(&listen_thread, NULL, us_server_thread, NULL,
+ "unixsock listen");
if (status != 0) {
char errbuf[1024];
ERROR("unixsock plugin: pthread_create failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
if (status != 0) {
char errbuf[1024];
ERROR("unixsock plugin: pthread_create failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
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) */