aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2009-05-07 11:08:25 -0500
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 08:43:44 +0200
commit420c2b7629ca7f7c81896652edb93c3a97c87c4c (patch)
tree3f2d13ffe72c428267c87108e6d7ad3f9bb6d6cf
parent73ad1727443924d5efa94d5fad1ad3cfea3d3780 (diff)
downloadblktrace-420c2b7629ca7f7c81896652edb93c3a97c87c4c.tar.gz
blkrawverify: warn and return error if no traces are found
blkrawverify is prints no errors and returns success if the requested tracefiles aren't found: # blkrawverify foobar Verifying foobar # echo $? 0 With this change it's a bit more informative: # ./blkrawverify foobar Verifying foobar No tracefiles found for foobar # echo $? 1 Resolves Red Hat Bugzilla #499581 Reported-by: Milos Malik <mmalik@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--blkrawverify.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/blkrawverify.c b/blkrawverify.c
index 984dbff..e669179 100644
--- a/blkrawverify.c
+++ b/blkrawverify.c
@@ -296,8 +296,14 @@ int main(int argc, char *argv[])
printf("Verifying %s\n", devname); fflush(stdout);
for (cpu = 0; ; cpu++) {
sprintf(fname, "%s.blktrace.%d", devname, cpu);
- if (stat(fname, &st) < 0)
+ if (stat(fname, &st) < 0) {
+ if (cpu == 0) {
+ fprintf(stderr, "No tracefiles found for %s\n",
+ devname);
+ rval = 1;
+ }
break;
+ }
printf(" CPU %d ", cpu); fflush(stdout);
nbad = process(&ofp, devname, fname, cpu);
if (nbad) {