-static char *device_g = NULL;
-static cdtime_t ow_interval = 0;
-static _Bool direct_access = 0;
+static char *device_g;
+static cdtime_t ow_interval;
+static bool direct_access;
static const char *config_keys[] = {"Device", "IgnoreSelected", "Sensor",
"Interval"};
static const char *config_keys[] = {"Device", "IgnoreSelected", "Sensor",
"Interval"};
if (regcomp(®ex_direct, regexp_to_match, REG_EXTENDED)) {
ERROR("onewire plugin: Cannot compile regex");
direct_list_element_free(element);
if (regcomp(®ex_direct, regexp_to_match, REG_EXTENDED)) {
ERROR("onewire plugin: Cannot compile regex");
direct_list_element_free(element);
if (ignorelist_add(sensor_list, value)) {
ERROR("onewire plugin: Cannot add value to ignorelist.");
if (ignorelist_add(sensor_list, value)) {
ERROR("onewire plugin: Cannot add value to ignorelist.");
}
} else if (strcasecmp(key, "IgnoreSelected") == 0) {
ignorelist_set_invert(sensor_list, 1);
}
} else if (strcasecmp(key, "IgnoreSelected") == 0) {
ignorelist_set_invert(sensor_list, 1);
char file[4096];
char *endptr;
snprintf(file, sizeof(file), "%s/%s", path,
family_info->features[i].filename);
char file[4096];
char *endptr;
snprintf(file, sizeof(file), "%s/%s", path,
family_info->features[i].filename);
status = OW_get(file, &buffer, &buffer_size);
if (status < 0) {
ERROR("onewire plugin: OW_get (%s/%s) failed. error = %s;", path,
status = OW_get(file, &buffer, &buffer_size);
if (status < 0) {
ERROR("onewire plugin: OW_get (%s/%s) failed. error = %s;", path,
- family_info->features[i].filename,
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (-1);
+ family_info->features[i].filename, STRERRNO);
+ return -1;
- status = ssnprintf(subpath, sizeof(subpath), "%s/main", path);
+ status = snprintf(subpath, sizeof(subpath), "%s/main", path);
- status = ssnprintf(subpath, sizeof(subpath), "%s/aux", path);
+ status = snprintf(subpath, sizeof(subpath), "%s/aux", path);
- ERROR("onewire plugin: OW_get (%s) failed. error = %s;", path,
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (-1);
+ ERROR("onewire plugin: OW_get (%s) failed. error = %s;", path, STRERRNO);
+ return -1;
- status = ssnprintf(subpath, sizeof(subpath), "/%s", buffer_ptr);
+ status = snprintf(subpath, sizeof(subpath), "/%s", buffer_ptr);
- status = ssnprintf(subpath, sizeof(subpath), "%s/%s", path, buffer_ptr);
+ status = snprintf(subpath, sizeof(subpath), "%s/%s", path, buffer_ptr);
status = OW_get(traverse->path, &buffer, &buffer_size);
if (status < 0) {
ERROR("onewire plugin: OW_get (%s) failed. status = %s;", traverse->path,
status = OW_get(traverse->path, &buffer, &buffer_size);
if (status < 0) {
ERROR("onewire plugin: OW_get (%s) failed. status = %s;", traverse->path,
}
DEBUG("onewire plugin: about to init device <%s>.", device_g);
status = (int)OW_init(device_g);
if (status != 0) {
}
DEBUG("onewire plugin: about to init device <%s>.", device_g);
status = (int)OW_init(device_g);
if (status != 0) {
- ERROR("onewire plugin: OW_init(%s) failed: %s.", device_g,
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (1);
+ ERROR("onewire plugin: OW_init(%s) failed: %s.", device_g, STRERRNO);
+ return 1;
}
plugin_register_complex_read(/* group = */ NULL, "onewire", cow_read,
ow_interval, /* user data = */ NULL);
plugin_register_shutdown("onewire", cow_shutdown);
}
plugin_register_complex_read(/* group = */ NULL, "onewire", cow_read,
ow_interval, /* user data = */ NULL);
plugin_register_shutdown("onewire", cow_shutdown);
plugin_register_config("onewire", cow_load_config, config_keys,
config_keys_num);
}
plugin_register_config("onewire", cow_load_config, config_keys,
config_keys_num);
}