projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3047 from cjmayo/style_border
[collectd.git]
/
src
/
utils_mount.c
diff --git
a/src/utils_mount.c
b/src/utils_mount.c
index
3d57ca6
..
279f8e2
100644
(file)
--- a/
src/utils_mount.c
+++ b/
src/utils_mount.c
@@
-361,9
+361,7
@@
static cu_mount_t *cu_mount_listmntent(void) {
struct tabmntent *mntlist;
if (listmntent(&mntlist, COLLECTD_MNTTAB, NULL, NULL) < 0) {
#if COLLECT_DEBUG
struct tabmntent *mntlist;
if (listmntent(&mntlist, COLLECTD_MNTTAB, NULL, NULL) < 0) {
#if COLLECT_DEBUG
- char errbuf[1024];
- DEBUG("utils_mount: calling listmntent() failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ DEBUG("utils_mount: calling listmntent() failed: %s", STRERRNO);
#endif /* COLLECT_DEBUG */
}
#endif /* COLLECT_DEBUG */
}
@@
-431,9
+429,7
@@
static cu_mount_t *cu_mount_getfsstat(void) {
/* Get the number of mounted file systems */
if ((bufsize = CMD_STATFS(NULL, 0, FLAGS_STATFS)) < 1) {
#if COLLECT_DEBUG
/* Get the number of mounted file systems */
if ((bufsize = CMD_STATFS(NULL, 0, FLAGS_STATFS)) < 1) {
#if COLLECT_DEBUG
- char errbuf[1024];
- DEBUG("utils_mount: getv?fsstat failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ DEBUG("utils_mount: getv?fsstat failed: %s", STRERRNO);
#endif /* COLLECT_DEBUG */
return NULL;
}
#endif /* COLLECT_DEBUG */
return NULL;
}
@@
-446,9
+442,7
@@
static cu_mount_t *cu_mount_getfsstat(void) {
if ((num = CMD_STATFS(buf, bufsize * sizeof(STRUCT_STATFS), FLAGS_STATFS)) <
1) {
#if COLLECT_DEBUG
if ((num = CMD_STATFS(buf, bufsize * sizeof(STRUCT_STATFS), FLAGS_STATFS)) <
1) {
#if COLLECT_DEBUG
- char errbuf[1024];
- DEBUG("utils_mount: getv?fsstat failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ DEBUG("utils_mount: getv?fsstat failed: %s", STRERRNO);
#endif /* COLLECT_DEBUG */
free(buf);
return NULL;
#endif /* COLLECT_DEBUG */
free(buf);
return NULL;
@@
-495,9
+489,7
@@
static cu_mount_t *cu_mount_gen_getmntent(void) {
DEBUG("utils_mount: (void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB);
if ((fp = fopen(COLLECTD_MNTTAB, "r")) == NULL) {
DEBUG("utils_mount: (void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB);
if ((fp = fopen(COLLECTD_MNTTAB, "r")) == NULL) {
- char errbuf[1024];
- ERROR("fopen (%s): %s", COLLECTD_MNTTAB,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("fopen (%s): %s", COLLECTD_MNTTAB, STRERRNO);
return NULL;
}
return NULL;
}
@@
-527,7
+519,6
@@
static cu_mount_t *cu_mount_gen_getmntent(void) {
return first;
} /* static cu_mount_t *cu_mount_gen_getmntent (void) */
return first;
} /* static cu_mount_t *cu_mount_gen_getmntent (void) */
- /* #endif HAVE_TWO_GETMNTENT || HAVE_GEN_GETMNTENT || HAVE_SUN_GETMNTENT */
#elif HAVE_SEQ_GETMNTENT
#warn "This version of `getmntent' hat not yet been implemented!"
#elif HAVE_SEQ_GETMNTENT
#warn "This version of `getmntent' hat not yet been implemented!"
@@
-546,9
+537,7
@@
static cu_mount_t *cu_mount_getmntent(void) {
DEBUG("utils_mount: (void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB);
if ((fp = setmntent(COLLECTD_MNTTAB, "r")) == NULL) {
DEBUG("utils_mount: (void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB);
if ((fp = setmntent(COLLECTD_MNTTAB, "r")) == NULL) {
- char errbuf[1024];
- ERROR("setmntent (%s): %s", COLLECTD_MNTTAB,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("setmntent (%s): %s", COLLECTD_MNTTAB, STRERRNO);
return NULL;
}
return NULL;
}
@@
-597,9
+586,7
@@
static cu_mount_t *cu_mount_getmntent(void) {
DEBUG("utils_mount: (void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB);
if ((fp = setmntent(COLLECTD_MNTTAB, "r")) == NULL) {
DEBUG("utils_mount: (void); COLLECTD_MNTTAB = %s", COLLECTD_MNTTAB);
if ((fp = setmntent(COLLECTD_MNTTAB, "r")) == NULL) {
- char errbuf[1024];
- ERROR("setmntent (%s): %s", COLLECTD_MNTTAB,
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ ERROR("setmntent (%s): %s", COLLECTD_MNTTAB, STRERRNO);
return NULL;
}
return NULL;
}
@@
-664,6
+651,8
@@
cu_mount_t *cu_mount_getlist(cu_mount_t **list) {
new = cu_mount_gen_getmntent();
#elif HAVE_SEQ_GETMNTENT
#error "This version of `getmntent' hat not yet been implemented!"
new = cu_mount_gen_getmntent();
#elif HAVE_SEQ_GETMNTENT
#error "This version of `getmntent' hat not yet been implemented!"
+#elif HAVE_GETMNTENT_R
+ new = cu_mount_getmntent();
#elif HAVE_ONE_GETMNTENT
new = cu_mount_getmntent();
#else
#elif HAVE_ONE_GETMNTENT
new = cu_mount_getmntent();
#else
@@
-701,7
+690,7
@@
void cu_mount_freelist(cu_mount_t *list) {
char *cu_mount_checkoption(char *line, const char *keyword, int full) {
char *line2, *l2, *p1, *p2;
char *cu_mount_checkoption(char *line, const char *keyword, int full) {
char *line2, *l2, *p1, *p2;
-
in
t l;
+
size_
t l;
if (line == NULL || keyword == NULL) {
return NULL;
if (line == NULL || keyword == NULL) {
return NULL;