failtest: fix tracepath bug.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 00:52:39 +0000 (11:22 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 00:52:39 +0000 (11:22 +1030)
Aborts on a short write with --tracepath.

ccan/failtest/failtest.c

index 77aea9a7de6e185226f07a63b7ecb47dadf3a93b..7d842d80fd035c9331ff7819c38906d30804aff3 100644 (file)
@@ -219,7 +219,7 @@ static void trace_str(const char *str)
 {
        ssize_t ret;
 
-       while ((ret = write(tracefd, str, strlen(str))) <= 0) {
+       while ((ret = write(tracefd, str, strlen(str))) > 0) {
                str += ret;
                if (!*str)
                        return;