X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_mount.c;h=2cab4817604f513258d986faca491b5f31271186;hb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec;hp=bbc4c209dcf8a3c6b201bbfce35798fd4ee5c1e3;hpb=662c44a84ae3daecd4ffdea940fffce35a41b52a;p=collectd.git diff --git a/src/utils_mount.c b/src/utils_mount.c index bbc4c209..2cab4817 100644 --- a/src/utils_mount.c +++ b/src/utils_mount.c @@ -258,7 +258,7 @@ static void uuidcache_init(void) { * (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); } @@ -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 - 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 */ } @@ -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 - 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; } @@ -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 - 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; @@ -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) { - char errbuf[1024]; - ERROR("fopen (%s): %s", COLLECTD_MNTTAB, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("fopen (%s): %s", COLLECTD_MNTTAB, STRERRNO); return NULL; } @@ -546,9 +538,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) { - char errbuf[1024]; - ERROR("setmntent (%s): %s", COLLECTD_MNTTAB, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("setmntent (%s): %s", COLLECTD_MNTTAB, STRERRNO); return NULL; } @@ -597,9 +587,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) { - char errbuf[1024]; - ERROR("setmntent (%s): %s", COLLECTD_MNTTAB, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("setmntent (%s): %s", COLLECTD_MNTTAB, STRERRNO); return NULL; }