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 #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
utils_mount.c
diff --git
a/src/utils_mount.c
b/src/utils_mount.c
index
a2e96a6
..
b8dabb1
100644
(file)
--- a/
src/utils_mount.c
+++ b/
src/utils_mount.c
@@
-216,7
+216,6
@@
uuidcache_init(void)
FILE *procpt;
char uuid[16], *label = NULL;
char device[110];
FILE *procpt;
char uuid[16], *label = NULL;
char device[110];
- int firstPass;
int handleOnFirst;
if(uuidCache) {
int handleOnFirst;
if(uuidCache) {
@@
-228,7
+227,7
@@
uuidcache_init(void)
return;
}
return;
}
- for(firstPass = 1; firstPass >= 0; firstPass--) {
+ for(
int
firstPass = 1; firstPass >= 0; firstPass--) {
fseek(procpt, 0, SEEK_SET);
while(fgets(line, sizeof(line), procpt)) {
if(sscanf(line, " %d %d %d %[^\n ]",
fseek(procpt, 0, SEEK_SET);
while(fgets(line, sizeof(line), procpt)) {
if(sscanf(line, " %d %d %d %[^\n ]",
@@
-318,14
+317,13
@@
static char *
get_spec_by_uuid(const char *s)
{
char uuid[16];
get_spec_by_uuid(const char *s)
{
char uuid[16];
- int i;
if(strlen(s) != 36
|| s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-') {
goto bad_uuid;
}
if(strlen(s) != 36
|| s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-') {
goto bad_uuid;
}
- for(i=0; i<16; i++) {
+ for(i
nt i
=0; i<16; i++) {
if(*s == '-') {
s++;
}
if(*s == '-') {
s++;
}
@@
-382,7
+380,6
@@
static char *get_device_name(const char *optstr)
static cu_mount_t *cu_mount_listmntent (void)
{
cu_mount_t *last = *list;
static cu_mount_t *cu_mount_listmntent (void)
{
cu_mount_t *last = *list;
- struct tabmntent *p;
struct mntent *mnt;
struct tabmntent *mntlist;
struct mntent *mnt;
struct tabmntent *mntlist;
@@
-394,7
+391,7
@@
static cu_mount_t *cu_mount_listmntent (void)
#endif /* COLLECT_DEBUG */
}
#endif /* COLLECT_DEBUG */
}
- for(p = mntlist; p; p = p->next) {
+ for(
struct tabmntent *
p = mntlist; p; p = p->next) {
char *loop = NULL, *device = NULL;
mnt = p->ment;
char *loop = NULL, *device = NULL;
mnt = p->ment;
@@
-451,7
+448,6
@@
static cu_mount_t *cu_mount_getfsstat (void)
STRUCT_STATFS *buf;
int num;
STRUCT_STATFS *buf;
int num;
- int i;
cu_mount_t *first = NULL;
cu_mount_t *last = NULL;
cu_mount_t *first = NULL;
cu_mount_t *last = NULL;
@@
-484,7
+480,7
@@
static cu_mount_t *cu_mount_getfsstat (void)
return (NULL);
}
return (NULL);
}
- for (i = 0; i < num; i++)
+ for (i
nt i
= 0; i < num; i++)
{
if ((new = calloc (1, sizeof (*new))) == NULL)
break;
{
if ((new = calloc (1, sizeof (*new))) == NULL)
break;
@@
-741,10
+737,9
@@
cu_mount_t *cu_mount_getlist(cu_mount_t **list)
void cu_mount_freelist (cu_mount_t *list)
{
void cu_mount_freelist (cu_mount_t *list)
{
- cu_mount_t *this;
cu_mount_t *next;
cu_mount_t *next;
- for (this = list; this != NULL; this = next)
+ for (
cu_mount_t *
this = list; this != NULL; this = next)
{
next = this->next;
{
next = this->next;