} /* while (fgets) */
if (fclose(fh)) {
- char errbuf[1024];
- WARNING("processes: fclose: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("processes: fclose: %s", STRERRNO);
}
}
closedir(dh);
} /* while (fgets) */
if (fclose(fh)) {
- char errbuf[1024];
- WARNING("processes: fclose: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("processes: fclose: %s", STRERRNO);
}
ps->vmem_data = data * 1024;
} /* while (fgets) */
if (fclose(fh)) {
- char errbuf[1024];
- WARNING("processes: fclose: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("processes: fclose: %s", STRERRNO);
}
return 0;
} /* int ps_read_io (...) */
} /* while (fgets) */
if (fclose(fh)) {
- char errbuf[1024];
- WARNING("processes: fclose: %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("processes: fclose: %s", STRERRNO);
}
return count;
} /* int ps_count_maps (...) */
errno = 0;
fd = open(file, O_RDONLY);
if (fd < 0) {
- char errbuf[4096];
/* ENOENT means the process exited while we were handling it.
* Don't complain about this, it only fills the logs. */
if (errno != ENOENT)
- WARNING("processes plugin: Failed to open `%s': %s.", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("processes plugin: Failed to open `%s': %s.", file, STRERRNO);
return NULL;
}
status = read(fd, (void *)buf_ptr, len);
if (status < 0) {
- char errbuf[1024];
if ((EAGAIN == errno) || (EINTR == errno))
continue;
WARNING("processes plugin: Failed to read from `%s': %s.", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ STRERRNO);
close(fd);
return NULL;
}
proc_stat = fopen("/proc/stat", "r");
if (proc_stat == NULL) {
- char errbuf[1024];
- ERROR("processes plugin: fopen (/proc/stat) failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("processes plugin: fopen (/proc/stat) failed: %s", STRERRNO);
return -1;
}
ps_list_reset();
if ((proc = opendir("/proc")) == NULL) {
- char errbuf[1024];
- ERROR("Cannot open `/proc': %s", sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("Cannot open `/proc': %s", STRERRNO);
return -1;
}