X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fexec.c;h=df057189e47678fa722d3ca672d16215ba0034ba;hb=bb546b76861af78f65db1f175842e30d22ca9c03;hp=c84c1c7b63463440dd99aa71dd78f26c9c8a2b1a;hpb=2079ee1517e34de372f58e7e2267ad5c71a8a41f;p=collectd.git diff --git a/src/exec.c b/src/exec.c index c84c1c7b..df057189 100644 --- a/src/exec.c +++ b/src/exec.c @@ -250,7 +250,7 @@ static void set_environment(void) /* {{{ */ CDTIME_T_TO_DOUBLE(plugin_get_interval())); setenv("COLLECTD_INTERVAL", buffer, /* overwrite = */ 1); - ssnprintf(buffer, sizeof(buffer), "%s", hostname_g); + sstrncpy(buffer, hostname_g, sizeof(buffer)); setenv("COLLECTD_HOSTNAME", buffer, /* overwrite = */ 1); #else ssnprintf(buffer, sizeof(buffer), "COLLECTD_INTERVAL=%.3f", @@ -500,7 +500,7 @@ failed: static int parse_line(char *buffer) /* {{{ */ { if (strncasecmp("PUTVAL", buffer, strlen("PUTVAL")) == 0) - return (handle_putval(stdout, buffer)); + return (cmd_handle_putval(stdout, buffer)); else if (strncasecmp("PUTNOTIF", buffer, strlen("PUTNOTIF")) == 0) return (handle_putnotif(stdout, buffer)); else { @@ -787,7 +787,7 @@ static int exec_read(void) /* {{{ */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - plugin_thread_create(&t, &attr, exec_read_one, (void *)pl); + plugin_thread_create(&t, &attr, exec_read_one, (void *)pl, "exec read"); pthread_attr_destroy(&attr); } /* for (pl) */ @@ -826,7 +826,8 @@ static int exec_notification(const notification_t *n, /* {{{ */ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - plugin_thread_create(&t, &attr, exec_notification_one, (void *)pln); + plugin_thread_create(&t, &attr, exec_notification_one, (void *)pln, + "exec notify"); pthread_attr_destroy(&attr); } /* for (pl) */ @@ -865,7 +866,3 @@ void module_register(void) { /* user_data = */ NULL); plugin_register_shutdown("exec", exec_shutdown); } /* void module_register */ - -/* - * vim:shiftwidth=2:softtabstop=2:tabstop=8:fdm=marker - */