[Pkg-samba-maint] [samba] 101/135: examples: Fix scanf format in perf_writer_disk.

Ivo De Decker ivodd at moszumanska.debian.org
Sat Jan 11 21:30:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

ivodd pushed a commit to branch master
in repository samba.

commit e0bd27b9e055231c003164523b8adcab8ca5dccf
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Nov 15 17:02:17 2013 +0100

    examples: Fix scanf format in perf_writer_disk.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit f71b5e44e7a705096e4fdd7aa3d0e22df994e363)
---
 examples/perfcounter/perf_writer_disk.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/perfcounter/perf_writer_disk.c b/examples/perfcounter/perf_writer_disk.c
index 15188d2..18a63a4 100644
--- a/examples/perfcounter/perf_writer_disk.c
+++ b/examples/perfcounter/perf_writer_disk.c
@@ -132,7 +132,7 @@ void get_diskinfo(PERF_DATA_BLOCK *data)
 	int status, num;
 	char buf[LARGE_BUF], *start;
 	FILE *diskstats;
-	long reads, writes, discard;
+	unsigned long reads, writes, discard;
 
 	diskstats = fopen("/proc/diskstats", "r");
 	rewind(diskstats);
@@ -147,10 +147,10 @@ void get_diskinfo(PERF_DATA_BLOCK *data)
 		p->freeMegs = (statfsbuf.f_bfree*statfsbuf.f_bsize)/1048576;
 		start = strstr(buf, data->diskInfo.mdata[i].name);
 		start += strlen(data->diskInfo.mdata[i].name) + 1;
-		num = sscanf(start, "%u %u %u %u",
+		num = sscanf(start, "%lu %lu %lu %lu",
 			     &reads,
-			     &discard, 
-			     &writes, 
+			     &discard,
+			     &writes,
 			     &discard);
 		p->writesPerSec = writes;
 		p->readsPerSec = reads;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list