static int vserver_init(void) {
/* XXX Should we check for getpagesize () in configure?
* What's the right thing to do, if there is no getpagesize ()? */
pagesize = getpagesize();
static int vserver_init(void) {
/* XXX Should we check for getpagesize () in configure?
* What's the right thing to do, if there is no getpagesize ()? */
pagesize = getpagesize();
} /* static void vserver_init(void) */
static void traffic_submit(const char *plugin_instance,
} /* static void vserver_init(void) */
static void traffic_submit(const char *plugin_instance,
- char errbuf[1024];
- ERROR("vserver plugin: fopen (%s): %s", PROCDIR,
- sstrerror(errno, errbuf, sizeof(errbuf)));
- return (-1);
+ ERROR("vserver plugin: fopen (%s): %s", PROCDIR, STRERRNO);
+ return -1;
if (errno == 0) /* end of directory */
break;
ERROR("vserver plugin: failed to read directory %s: %s", PROCDIR,
if (errno == 0) /* end of directory */
break;
ERROR("vserver plugin: failed to read directory %s: %s", PROCDIR,
- len = ssnprintf(file, sizeof(file), PROCDIR "/%s", dent->d_name);
+ len = snprintf(file, sizeof(file), PROCDIR "/%s", dent->d_name);
if ((len < 0) || (len >= BUFSIZE))
continue;
status = stat(file, &statbuf);
if (status != 0) {
if ((len < 0) || (len >= BUFSIZE))
continue;
status = stat(file, &statbuf);
if (status != 0) {
- char errbuf[4096];
- WARNING("vserver plugin: stat (%s) failed: %s", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("vserver plugin: stat (%s) failed: %s", file, STRERRNO);
- len = ssnprintf(file, sizeof(file), PROCDIR "/%s/cacct", dent->d_name);
+ len = snprintf(file, sizeof(file), PROCDIR "/%s/cacct", dent->d_name);
if ((len < 0) || ((size_t)len >= sizeof(file)))
continue;
if (NULL == (fh = fopen(file, "r"))) {
if ((len < 0) || ((size_t)len >= sizeof(file)))
continue;
if (NULL == (fh = fopen(file, "r"))) {
- char errbuf[1024];
- ERROR("Cannot open '%s': %s", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("Cannot open '%s': %s", file, STRERRNO);
- len = ssnprintf(file, sizeof(file), PROCDIR "/%s/cvirt", dent->d_name);
+ len = snprintf(file, sizeof(file), PROCDIR "/%s/cvirt", dent->d_name);
if ((len < 0) || ((size_t)len >= sizeof(file)))
continue;
if (NULL == (fh = fopen(file, "r"))) {
if ((len < 0) || ((size_t)len >= sizeof(file)))
continue;
if (NULL == (fh = fopen(file, "r"))) {
- char errbuf[1024];
- ERROR("Cannot open '%s': %s", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("Cannot open '%s': %s", file, STRERRNO);
- len = ssnprintf(file, sizeof(file), PROCDIR "/%s/limit", dent->d_name);
+ len = snprintf(file, sizeof(file), PROCDIR "/%s/limit", dent->d_name);
if ((len < 0) || ((size_t)len >= sizeof(file)))
continue;
if (NULL == (fh = fopen(file, "r"))) {
if ((len < 0) || ((size_t)len >= sizeof(file)))
continue;
if (NULL == (fh = fopen(file, "r"))) {
- char errbuf[1024];
- ERROR("Cannot open '%s': %s", file,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("Cannot open '%s': %s", file, STRERRNO);
} /* int vserver_read */
void module_register(void) {
plugin_register_init("vserver", vserver_init);
plugin_register_read("vserver", vserver_read);
} /* void module_register(void) */
} /* int vserver_read */
void module_register(void) {
plugin_register_init("vserver", vserver_init);
plugin_register_read("vserver", vserver_read);
} /* void module_register(void) */