if BUILD_PLUGIN_EXEC
pkglib_LTLIBRARIES += exec.la
exec_la_SOURCES = exec.c
-exec_la_LDFLAGS = $(PLUGIN_LDFLAGS) libcmds.la
+exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+exec_la_LIBADD = libcmds.la
endif
if BUILD_PLUGIN_ETHSTAT
if BUILD_PLUGIN_UNIXSOCK
pkglib_LTLIBRARIES += unixsock.la
unixsock_la_SOURCES = unixsock.c
-unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS) libcmds.la
+unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+unixsock_la_LIBADD = libcmds.la
endif
if BUILD_PLUGIN_UPTIME
ssnprintf(filename, sizeof(filename), "%s/%s/%s", dir, power_supply,
basename);
- status = (int)read_file_contents(filename, buffer, buffer_size);
+ status = (int)read_file_contents(filename, buffer, buffer_size - 1);
if (status < 0)
return status;
+ buffer[status] = '\0';
+
strstripnewline(buffer);
return 0;
} /* }}} int sysfs_file_to_buffer */
char const *power_supply, char const *basename,
gauge_t *ret_value) {
int status;
- char buffer[32] = "";
+ char buffer[32];
status =
sysfs_file_to_buffer(dir, power_supply, basename, buffer, sizeof(buffer));
static void dpdk_config_init_default(void) {
g_configuration->interval = plugin_get_interval();
if (g_configuration->interval == cf_get_default_interval())
- WARNING("dpdkstat: No time interval was configured, default value %lu ms "
- "is set",
+ WARNING("dpdkstat: No time interval was configured, default value %" PRIu64
+ " ms is set",
CDTIME_T_TO_MS(g_configuration->interval));
/* Default is all ports enabled */
g_configuration->enabled_port_mask = ~0;
if (err) {
ERROR("dpdkstat semaphore init failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
- goto fail_close;
+ goto close;
}
err = sem_init(&g_configuration->sema_stats_in_shm, 1, 0);
if (err) {
ERROR("dpdkstat semaphore init failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
- goto fail_close;
+ goto close;
}
g_configuration->xstats = NULL;
if (pid > 0) {
close(g_configuration->helper_pipes[1]);
g_configuration->helper_pid = pid;
- DEBUG("dpdkstat: helper pid %lu", (long)g_configuration->helper_pid);
+ DEBUG("dpdkstat: helper pid %li", (long)g_configuration->helper_pid);
/* Kick helper once its alive to have it start processing */
sem_post(&g_configuration->sema_helper_get_stats);
} else if (pid == 0) {