X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Ftools.c;h=c8697320a9fd5616c5dfa1e04af686efec0c1a87;hp=0a29ddf8e64cce7875a8a9d8c8fe37a0c6d90a13;hb=af5b1a18948345c5f9f9abf4eda3ab9fe0aa9a9f;hpb=04f453bbedd1eca3e5ab93290304d8193ffdd87f;ds=sidebyside diff --git a/tools/tools.c b/tools/tools.c index 0a29ddf8..c8697320 100644 --- a/tools/tools.c +++ b/tools/tools.c @@ -213,8 +213,7 @@ int unlink_file_destructor(char *filename) return 0; } -char *maybe_temp_file(const void *ctx, const char *extension, bool keep, - const char *srcname) +char *temp_file(const void *ctx, const char *extension, const char *srcname) { unsigned baselen; char *f, *suffix = talloc_strdup(ctx, ""); @@ -237,10 +236,7 @@ char *maybe_temp_file(const void *ctx, const char *extension, bool keep, } while (lstat(f, &st) == 0); if (tools_verbose) - printf("Creating %sfile %s\n", keep ? "" : "temporary ", f); - - if (!keep) - talloc_set_destructor(f, unlink_file_destructor); + printf("Creating file %s\n", f); talloc_free(suffix); return f;