From 4e894668a7b8917c4efbb88c6fbce157fc90d4aa Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 15 Jun 2009 23:31:47 +0200 Subject: [PATCH] Don't fail when removing nonexistent files in move_file --- ChangeLog | 5 +++++ src/util.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 557de8d..d86820a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-15 Andreas Gruenbacher + + * src/util.c (move_file): Don't fail when removing nonexistent + files: this condition is already checked in maybe_reverse(). + 2009-06-05 Andreas Gruenbacher * gl/lib/getopt_int.h, gl/lib/strndup.c, gl/m4/strndup.m4: Add diff --git a/src/util.c b/src/util.c index 54ca328..ea320df 100644 --- a/src/util.c +++ b/src/util.c @@ -328,7 +328,7 @@ move_file (char const *from, int volatile *from_needs_removal, { if (debug & 4) say ("Removing file %s\n", quotearg (to)); - if (unlink (to) != 0) + if (unlink (to) != 0 && errno != ENOENT) pfatal ("Can't remove file %s", quotearg (to)); } }