* (This is useful, if the cdrom on /dev/hdc must not
* be accessed.)
*/
- ssnprintf(device, sizeof(device), "%s/%s", DEVLABELDIR, ptname);
+ snprintf(device, sizeof(device), "%s/%s", DEVLABELDIR, ptname);
if (!get_label_uuid(device, &label, uuid)) {
uuidcache_addentry(sstrdup(device), label, uuid);
}
static unsigned char fromhex(char c) {
if (isdigit((int)c)) {
- return (c - '0');
+ return c - '0';
} else if (islower((int)c)) {
- return (c - 'a' + 10);
+ return c - 'a' + 10;
} else {
- return (c - 'A' + 10);
+ return c - 'A' + 10;
}
}
char *rc;
if (optstr == NULL) {
- return (NULL);
+ return NULL;
} else if (strncmp(optstr, "UUID=", 5) == 0) {
DEBUG("utils_mount: TODO: check UUID= code!");
rc = get_spec_by_uuid(optstr + 5);
last->next = NULL;
} /* for(p = mntlist; p; p = p->next) */
- return (last);
+ return last;
} /* cu_mount_t *cu_mount_listmntent(void) */
/* #endif HAVE_LISTMNTENT */
DEBUG("utils_mount: getv?fsstat failed: %s",
sstrerror(errno, errbuf, sizeof(errbuf)));
#endif /* COLLECT_DEBUG */
- return (NULL);
+ return NULL;
}
if ((buf = calloc(bufsize, sizeof(*buf))) == NULL)
- return (NULL);
+ return NULL;
/* The bufsize needs to be passed in bytes. Really. This is not in the
* manpage.. -octo */
sstrerror(errno, errbuf, sizeof(errbuf)));
#endif /* COLLECT_DEBUG */
free(buf);
- return (NULL);
+ return NULL;
}
for (int i = 0; i < num; i++) {
free(buf);
- return (first);
+ return first;
}
/* #endif HAVE_GETVFSSTAT || HAVE_GETFSSTAT */
char errbuf[1024];
ERROR("fopen (%s): %s", COLLECTD_MNTTAB,
sstrerror(errno, errbuf, sizeof(errbuf)));
- return (NULL);
+ return NULL;
}
while (getmntent(fp, &mt) == 0) {
fclose(fp);
- return (first);
+ return first;
} /* static cu_mount_t *cu_mount_gen_getmntent (void) */
-/* #endif HAVE_TWO_GETMNTENT || HAVE_GEN_GETMNTENT || HAVE_SUN_GETMNTENT */
+ /* #endif HAVE_TWO_GETMNTENT || HAVE_GEN_GETMNTENT || HAVE_SUN_GETMNTENT */
#elif HAVE_SEQ_GETMNTENT
#warn "This version of `getmntent' hat not yet been implemented!"
char errbuf[1024];
ERROR("setmntent (%s): %s", COLLECTD_MNTTAB,
sstrerror(errno, errbuf, sizeof(errbuf)));
- return (NULL);
+ return NULL;
}
while (getmntent_r(fp, &me, mntbuf, sizeof(mntbuf))) {
endmntent(fp);
- DEBUG("utils_mount: return (0x%p)", (void *)first);
+ DEBUG("utils_mount: return 0x%p", (void *)first);
- return (first);
+ return first;
} /* HAVE_GETMNTENT_R */
#elif HAVE_ONE_GETMNTENT
char errbuf[1024];
ERROR("setmntent (%s): %s", COLLECTD_MNTTAB,
sstrerror(errno, errbuf, sizeof(errbuf)));
- return (NULL);
+ return NULL;
}
while ((me = getmntent(fp)) != NULL) {
endmntent(fp);
- DEBUG("utils_mount: return (0x%p)", (void *)first);
+ DEBUG("utils_mount: return 0x%p", (void *)first);
- return (first);
+ return first;
}
#endif /* HAVE_ONE_GETMNTENT */
cu_mount_t *last = NULL;
if (list == NULL)
- return (NULL);
+ return NULL;
if (*list != NULL) {
first = *list;
while ((last != NULL) && (last->next != NULL))
last = last->next;
- return (last);
+ return last;
} /* cu_mount_t *cu_mount_getlist(cu_mount_t **list) */
void cu_mount_freelist(cu_mount_t *list) {