char *buffer;
size_t buffer_size;
int status;
- char errbuf[1024];
char file[4096];
char *endptr;
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)));
+ family_info->features[i].filename, STRERRNO);
return -1;
}
DEBUG("Read onewire device %s as %s", file, buffer);
char subpath[4096];
int status;
- status = ssnprintf(subpath, sizeof(subpath), "%s/main", path);
+ status = snprintf(subpath, sizeof(subpath), "%s/main", path);
if ((status > 0) && (status < (int)sizeof(subpath)))
cow_read_bus(subpath);
- status = ssnprintf(subpath, sizeof(subpath), "%s/aux", path);
+ status = snprintf(subpath, sizeof(subpath), "%s/aux", path);
if ((status > 0) && (status < (int)sizeof(subpath)))
cow_read_bus(subpath);
char *buffer;
size_t buffer_size;
int status;
- char errbuf[1024];
char *buffer_ptr;
char *dummy;
status = OW_get(path, &buffer, &buffer_size);
if (status < 0) {
- ERROR("onewire plugin: OW_get (%s) failed. error = %s;", path,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("onewire plugin: OW_get (%s) failed. error = %s;", path, STRERRNO);
return -1;
}
DEBUG("onewire plugin: OW_get (%s) returned: %s", path, buffer);
dummy = NULL;
if (strcmp("/", path) == 0)
- status = ssnprintf(subpath, sizeof(subpath), "/%s", buffer_ptr);
+ status = snprintf(subpath, sizeof(subpath), "/%s", buffer_ptr);
else
- status = ssnprintf(subpath, sizeof(subpath), "%s/%s", path, buffer_ptr);
+ status = snprintf(subpath, sizeof(subpath), "%s/%s", path, buffer_ptr);
if ((status <= 0) || (status >= (int)sizeof(subpath)))
continue;
char *buffer;
size_t buffer_size;
int status;
- char errbuf[1024];
char *endptr;
direct_access_element_t *traverse;
status = OW_get(traverse->path, &buffer, &buffer_size);
if (status < 0) {
ERROR("onewire plugin: OW_get (%s) failed. status = %s;", traverse->path,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ STRERRNO);
return -1;
}
DEBUG("onewire plugin: Read onewire device %s as %s", traverse->path,
static int cow_init(void) {
int status;
- char errbuf[1024];
if (device_g == NULL) {
ERROR("onewire plugin: cow_init: No device configured.");
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)));
+ ERROR("onewire plugin: OW_init(%s) failed: %s.", device_g, STRERRNO);
return 1;
}