summaryrefslogtreecommitdiff
path: root/verify_blkparse.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-10-05 09:53:31 +0200
committerJens Axboe <axboe@suse.de>2005-10-05 09:53:31 +0200
commitb99d16379d8dfde1986ff1b882460ca0a80bbd87 (patch)
tree3c4df8896b6f3627abc9ff541671c3bbafe8c2ea /verify_blkparse.c
parent8d1fb00b10f1a27acc9fc1afeddec091e0e11057 (diff)
downloadblktrace-b99d16379d8dfde1986ff1b882460ca0a80bbd87.tar.gz
blktrace-b99d16379d8dfde1986ff1b882460ca0a80bbd87.tar.bz2
[PATCH] verify_blkparse: correct sscanf return
Diffstat (limited to 'verify_blkparse.c')
-rw-r--r--verify_blkparse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/verify_blkparse.c b/verify_blkparse.c
index 4385bc7..d8b854d 100644
--- a/verify_blkparse.c
+++ b/verify_blkparse.c
@@ -24,7 +24,7 @@ int main(int argc, char *argv[])
last_time = 0;
last_seq = alias = nr = 0;
while ((p = fgets(line, sizeof(line), f)) != NULL) {
- if (!sscanf(p, "%3d,%3d %2d %8d %lf", &major, &minor, &cpu, &seq, &this_time))
+ if (sscanf(p, "%3d,%3d %2d %8d %lf", &major, &minor, &cpu, &seq, &this_time) == -1)
break;
if (this_time < last_time) {
@@ -33,8 +33,10 @@ int main(int argc, char *argv[])
} else
last_time = this_time;
- if (last_seq == seq)
+ if (last_seq == seq) {
+ fprintf(stdout, "alias on sequence %u\n", seq);
alias++;
+ }
last_seq = seq;
}