X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fmodule_links.c;fp=tools%2Fccanlint%2Ftests%2Fmodule_links.c;h=5c25e6126589ebd0cadd01d15b4fd66e8a18e11c;hp=d665ba7d6672f7a86849f6683686e6bb83fa42a3;hb=10e5e329a1a8804ff6461e1724071364cf6be572;hpb=a64257be339a8485f66ca9bafd6be7077aa873cd diff --git a/tools/ccanlint/tests/module_links.c b/tools/ccanlint/tests/module_links.c index d665ba7d..5c25e612 100644 --- a/tools/ccanlint/tests/module_links.c +++ b/tools/ccanlint/tests/module_links.c @@ -58,10 +58,9 @@ static void check_use_build(struct manifest *m, { char *contents; char *tmpfile, *cmdout; - char *basename = talloc_asprintf(m, "%s/example.c", m->dir); int fd; - tmpfile = temp_file(m, ".c", basename); + tmpfile = temp_file(m, ".c", "example.c"); fd = open(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0600); if (fd < 0) @@ -73,7 +72,7 @@ static void check_use_build(struct manifest *m, "{\n" " return 0;\n" "}\n", - m->basename, m->basename); + m->modname, m->basename); if (write(fd, contents, strlen(contents)) != strlen(contents)) err(1, "Failure writing to temporary file %s", tmpfile); close(fd);