- 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",
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",
if (write(fd, contents, strlen(contents)) != strlen(contents))
err(1, "writing to temporary file %s", tmpsrc);
close(fd);
if (write(fd, contents, strlen(contents)) != strlen(contents))
err(1, "writing to temporary file %s", tmpsrc);
close(fd);