X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Fcheck_includes_build.c;h=4e2badda9ce3ff6863812b3a9c5d3734745779a4;hp=cc5edc4ccaabbf2525b9072a4e64da3ceef6d02f;hb=03a596908b779bbb4b7c2f739c5e238f8c5d6390;hpb=a40b318e7a07a452ae7456053727bd11b2fa49b4 diff --git a/tools/ccanlint/compulsory_tests/check_includes_build.c b/tools/ccanlint/compulsory_tests/check_includes_build.c index cc5edc4c..4e2badda 100644 --- a/tools/ccanlint/compulsory_tests/check_includes_build.c +++ b/tools/ccanlint/compulsory_tests/check_includes_build.c @@ -40,7 +40,7 @@ static void check_includes_build(struct manifest *m, unsigned int *timeleft, struct score *score) { char *contents; - char *tmpsrc, *tmpobj; + char *tmpsrc, *tmpobj, *cmdout; int fd; struct ccan_file *mainh = main_header(m); @@ -57,14 +57,13 @@ static void check_includes_build(struct manifest *m, err(1, "writing to temporary file %s", tmpsrc); close(fd); - score->error = compile_object(m, tmpsrc, ccan_dir, "", tmpobj); - if (score->error) { - score->error = talloc_asprintf(score, - "#include of the main header file:\n%s", - score->error); - } else { + if (compile_object(score, tmpsrc, ccan_dir, "", tmpobj, &cmdout)) { score->pass = true; score->score = score->total; + } else { + score->error = talloc_asprintf(score, + "#include of the main header file:\n%s", + cmdout); } }