Blame SOURCES/0016-Fix-issue-48-for-good-sar-skips-long-filesystem-name.patch

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