]> sourceware.org Git - lvm2.git/commitdiff
Hotfix to stop harness busylooping
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 13 Jan 2011 11:02:55 +0000 (11:02 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 13 Jan 2011 11:02:55 +0000 (11:02 +0000)
Harness seems to be able to busyloop in while cycle and not moving forward
for certain buffer - so check whethere there was some progress.
This fix allows to continue after failed cluster test.

Fix gcc warning for hiding global variable 's' -> sig.

test/lib/harness.c

index 5c6dd4fb2de9d28b90ea8363a3c33b9eca760df0..2bf2c81403a5ad3e41e809baa984ff774e97aef2 100644 (file)
@@ -54,10 +54,10 @@ static struct subst subst[2];
 #define FAILED 2
 #define WARNED 3
 
-static void handler( int s ) {
-       signal( s, SIG_DFL );
-       kill( pid, s );
-       die = s;
+static void handler( int sig ) {
+       signal( sig, SIG_DFL );
+       kill( pid, sig );
+       die = sig;
 }
 
 static int outline(char *buf, int start, int force) {
@@ -110,10 +110,12 @@ static int outline(char *buf, int start, int force) {
 }
 
 static void dump(void) {
-        int counter = 0;
+       int counter_last, counter = 0;
 
-        while ( counter < readbuf_used )
-                counter = outline( readbuf, counter, 1 );
+       while ( counter < readbuf_used && counter != counter_last ) {
+               counter_last = counter;
+               counter = outline( readbuf, counter, 1 );
+       }
 }
 
 static void clear(void) {
This page took 0.038666 seconds and 5 git commands to generate.