From 7f378422fa31037ceaee65476a7628b5b891c2d4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 25 Aug 2007 13:38:23 +0200 Subject: [PATCH] Use bfix_tmp_file() whereever possible. --- lib/sorter.h | 5 +---- lib/sorter/sorter.h | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/sorter.h b/lib/sorter.h index eebd2206..4cc8c995 100644 --- a/lib/sorter.h +++ b/lib/sorter.h @@ -538,10 +538,7 @@ struct fastbuf *fb1, struct fastbuf *fb2 #ifdef SORT_OUTPUT_FB return fb1; #else - bconfig(fb1, BCONFIG_IS_TEMP_FILE, 0); - if (rename(fb1->name, outname) < 0) - die("rename(%s,%s): %m", fb1->name, outname); - bclose(fb1); + bfix_tmp_file(fb1, outname); #endif } diff --git a/lib/sorter/sorter.h b/lib/sorter/sorter.h index d17f4197..e329fa29 100644 --- a/lib/sorter/sorter.h +++ b/lib/sorter/sorter.h @@ -272,10 +272,7 @@ static struct fastbuf *P(sort)( sorter_run(&ctx); #ifdef SORT_OUTPUT_FILE - if (rename(ctx.out_fb->name, out) < 0) - die("Cannot rename %s to %s: %m", ctx.out_fb->name, out); - bconfig(ctx.out_fb, BCONFIG_IS_TEMP_FILE, 0); - bclose(ctx.out_fb); + bfix_tmp_file(ctx.out_fb, out); ctx.out_fb = NULL; #endif return ctx.out_fb; -- 2.39.2