projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Run all changed files 68 8.c/1 *.h through clang-format agin..
[collectd.git]
/
src
/
vserver.c
diff --git
a/src/vserver.c
b/src/vserver.c
index
6f9d46b
..
e1d1b35
100644
(file)
--- a/
src/vserver.c
+++ b/
src/vserver.c
@@
-28,8
+28,8
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include <dirent.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/types.h>
@@
-42,7
+42,7
@@
#error "No applicable input method."
#endif
#error "No applicable input method."
#endif
-static int pagesize
= 0
;
+static int pagesize;
static int vserver_init(void) {
/* XXX Should we check for getpagesize () in configure?
static int vserver_init(void) {
/* XXX Should we check for getpagesize () in configure?
@@
-124,9
+124,7
@@
static int vserver_read(void) {
errno = 0;
proc = opendir(PROCDIR);
if (proc == NULL) {
errno = 0;
proc = opendir(PROCDIR);
if (proc == NULL) {
- char errbuf[1024];
- ERROR("vserver plugin: fopen (%s): %s", PROCDIR,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("vserver plugin: fopen (%s): %s", PROCDIR, STRERRNO);
return -1;
}
return -1;
}
@@
-146,13
+144,11
@@
static int vserver_read(void) {
errno = 0;
dent = readdir(proc);
if (dent == NULL) {
errno = 0;
dent = readdir(proc);
if (dent == NULL) {
- char errbuf[4096];
-
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,
-
sstrerror(errno, errbuf, sizeof(errbuf))
);
+
STRERRNO
);
closedir(proc);
return -1;
}
closedir(proc);
return -1;
}
@@
-166,9
+162,7
@@
static int vserver_read(void) {
status = stat(file, &statbuf);
if (status != 0) {
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);
continue;
}
continue;
}
@@
-181,9
+175,7
@@
static int vserver_read(void) {
continue;
if (NULL == (fh = fopen(file, "r"))) {
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);
}
while ((fh != NULL) && (NULL != fgets(buffer, BUFSIZE, fh))) {
}
while ((fh != NULL) && (NULL != fgets(buffer, BUFSIZE, fh))) {
@@
-225,9
+217,7
@@
static int vserver_read(void) {
continue;
if (NULL == (fh = fopen(file, "r"))) {
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);
}
while ((fh != NULL) && (NULL != fgets(buffer, BUFSIZE, fh))) {
}
while ((fh != NULL) && (NULL != fgets(buffer, BUFSIZE, fh))) {
@@
-271,9
+261,7
@@
static int vserver_read(void) {
continue;
if (NULL == (fh = fopen(file, "r"))) {
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);
}
while ((fh != NULL) && (NULL != fgets(buffer, BUFSIZE, fh))) {
}
while ((fh != NULL) && (NULL != fgets(buffer, BUFSIZE, fh))) {