|
|
72abff |
From fca187ac9893a35f10d20b8d7cfbda00d79c20dd Mon Sep 17 00:00:00 2001
|
|
|
72abff |
From: Sebastien GODARD <sysstat@users.noreply.github.com>
|
|
|
72abff |
Date: Tue, 24 Mar 2015 21:38:07 +0100
|
|
|
72abff |
Subject: [PATCH] Fix issue #48 for good: sar skips long filesystem names
|
|
|
72abff |
|
|
|
72abff |
How the number of filesystems is counted should be consistent with
|
|
|
72abff |
commit a82d6ab.
|
|
|
72abff |
|
|
|
72abff |
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
|
|
|
72abff |
(cherry picked from commit 1cf65800b12d015ed9add350a6e2b40e6bcd5267)
|
|
|
72abff |
---
|
|
|
72abff |
rd_stats.c | 5 +++--
|
|
|
72abff |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
72abff |
|
|
|
72abff |
diff --git a/rd_stats.c b/rd_stats.c
|
|
|
72abff |
index eff0348..cb45d82 100644
|
|
|
72abff |
--- a/rd_stats.c
|
|
|
72abff |
+++ b/rd_stats.c
|
|
|
72abff |
@@ -2394,7 +2394,7 @@ int get_usb_nr(void)
|
|
|
72abff |
int get_filesystem_nr(void)
|
|
|
72abff |
{
|
|
|
72abff |
FILE *fp;
|
|
|
72abff |
- char line[256], fs_name[MAX_FS_LEN], mountp[128];
|
|
|
72abff |
+ char line[512], fs_name[MAX_FS_LEN], mountp[256];
|
|
|
72abff |
int fs = 0;
|
|
|
72abff |
struct statvfs buf;
|
|
|
72abff |
|
|
|
72abff |
@@ -2407,7 +2407,8 @@ int get_filesystem_nr(void)
|
|
|
72abff |
if (line[0] == '/') {
|
|
|
72abff |
|
|
|
72abff |
/* Read filesystem name and mount point */
|
|
|
72abff |
- sscanf(line, "%71s %127s", fs_name, mountp);
|
|
|
72abff |
+ sscanf(line, "%127s", fs_name);
|
|
|
72abff |
+ sscanf(strchr(line, ' ') + 1, "%255s", mountp);
|
|
|
72abff |
|
|
|
72abff |
/* Replace octal codes */
|
|
|
72abff |
oct2chr(mountp);
|
|
|
72abff |
--
|
|
|
72abff |
2.14.3
|
|
|
72abff |
|