]> git.ozlabs.org Git - ccan-lca-2011.git/blobdiff - tools/ccanlint/compulsory_tests/build.c
From: Joseph Adams <joeyadams3.14159@gmail.com>
[ccan-lca-2011.git] / tools / ccanlint / compulsory_tests / build.c
index 1b3d878928b53ca738fba2c13b2f2f394a508d19..8b530131eb05b91711f81fd4c0060661a91b92b2 100644 (file)
@@ -44,9 +44,9 @@ static void *do_build(struct manifest *m)
        }
        filename = link_objects(m, obj_list(m), &err);
        if (filename) {
-               char *realname = talloc_asprintf(m, "../%s.o", m->basename);
+               char *realname = talloc_asprintf(m, "%s.o", m->dir);
                /* We leave this object file around, all built. */
-               if (rename(filename, realname) != 0)
+               if (!move_file(filename, realname))
                        return talloc_asprintf(m, "Failed to rename %s to %s",
                                               filename, realname);
                return NULL;
@@ -62,6 +62,7 @@ static const char *describe_build(struct manifest *m, void *check_result)
 }
 
 struct ccanlint build = {
+       .key = "build",
        .name = "Module can be built",
        .total_score = 1,
        .check = do_build,