]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/objects_build.c
ccanlint: avoid segfault when module_builds' linking fails
[ccan] / tools / ccanlint / tests / objects_build.c
index b86c53beeff096a2c27f1b7be76e10ff2ea8f890..d44b7e7464fd2410071697570fa9267a7de541bb 100644 (file)
@@ -1,6 +1,7 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
 #include <ccan/str/str.h>
+#include <ccan/tal/path/path.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -35,7 +36,7 @@ void build_objects(struct manifest *m,
 
        list_for_each(&m->c_files, i, list) {
                char *output;
-               char *fullfile = tal_fmt(m, "%s/%s", m->dir, i->name);
+               char *fullfile = path_join(m, m->dir, i->name);
 
                i->compiled[ctype] = temp_file(m, "", fullfile);
                if (!compile_object(score, fullfile, ccan_dir, compiler, flags,
@@ -57,7 +58,8 @@ void build_objects(struct manifest *m,
        if (!errors) {
                score->pass = true;
                score->score = score->total - warnings;
-       }
+       } else
+               build_failed = true;
 }
 
 static void check_objs_build(struct manifest *m,