All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blkrawverify: warn and return error if no traces are found
@ 2009-05-07 16:08 Eric Sandeen
  0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2009-05-07 16:08 UTC (permalink / raw)
  To: linux-btrace

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>
---

Index: blktrace/blkrawverify.c
=================================--- blktrace.orig/blkrawverify.c
+++ blktrace/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) {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-07 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-07 16:08 [PATCH] blkrawverify: warn and return error if no traces are found Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.