]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/main_header_compiles.c
tools: don't assume modules are immediately below ccan/ dir.
[ccan] / tools / ccanlint / tests / main_header_compiles.c
index 99f3aa38855928e8611dc0967f4ff854a65e6ed9..c6c51837a8f5833f2b7ce735d5d10c147a92f67d 100644 (file)
@@ -36,7 +36,6 @@ static struct ccan_file *main_header(struct manifest *m)
 }
 
 static void check_includes_build(struct manifest *m,
-                                bool keep,
                                 unsigned int *timeleft, struct score *score)
 {
        char *contents;
@@ -44,15 +43,15 @@ static void check_includes_build(struct manifest *m,
        int fd;
        struct ccan_file *mainh = main_header(m);
 
-       tmpsrc = maybe_temp_file(m, "-included.c", keep, mainh->fullname);
-       tmpobj = maybe_temp_file(m, ".o", keep, tmpsrc);
+       tmpsrc = temp_file(m, "-included.c", mainh->fullname);
+       tmpobj = temp_file(m, ".o", tmpsrc);
 
        fd = open(tmpsrc, O_WRONLY | O_CREAT | O_EXCL, 0600);
        if (fd < 0)
                err(1, "Creating temporary file %s", tmpsrc);
 
        contents = talloc_asprintf(tmpsrc, "#include <ccan/%s/%s.h>\n",
-                                  m->basename, m->basename);
+                                  m->modname, m->basename);
        if (write(fd, contents, strlen(contents)) != strlen(contents))
                err(1, "writing to temporary file %s", tmpsrc);
        close(fd);