]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/test/run-write.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / failtest / test / run-write.c
index 9f1f1d7fc8005fdda59cbe46684157329f2469be..6a712fec53a631ca64f34a96504751ba0af133f8 100644 (file)
@@ -1,11 +1,11 @@
+/* Include the C files directly. */
+#include <ccan/failtest/failtest.c>
 #include <stdlib.h>
 #include <setjmp.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <assert.h>
 #include <ccan/tap/tap.h>
-/* Include the C files directly. */
-#include <ccan/failtest/failtest.c>
 
 int main(int argc, char *argv[])
 {
@@ -21,7 +21,8 @@ int main(int argc, char *argv[])
        /* Child will fail, ignore. */
        if (fd < 0)
                failtest_exit(0);
-       write(fd, buf, strlen(buf));
+       if (write(fd, buf, strlen(buf)) != strlen(buf))
+               abort();
        ok1(lseek(fd, 0, SEEK_CUR) == strlen(buf));
 
        p = failtest_malloc(100, __FILE__, __LINE__);