failtest: fix fascist warn_unused_result warnings
[ccan] / ccan / failtest / test / run-write.c
index 9f1f1d7fc8005fdda59cbe46684157329f2469be..ada185a643004ba961ce3698026a822824ad9e84 100644 (file)
@@ -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__);