summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2009-06-15 23:31:47 +0200
committerAndreas Gruenbacher <agruen@suse.de>2009-06-15 23:31:47 +0200
commit4e894668a7b8917c4efbb88c6fbce157fc90d4aa (patch)
treef11cfd36a6d37c5f24494f23233cf3c84faee4df
parent6d9e60f59a055921a6fb161588fe204e2d359349 (diff)
downloadpatch-4e894668a7b8917c4efbb88c6fbce157fc90d4aa.tar.gz
Don't fail when removing nonexistent files in move_file
-rw-r--r--ChangeLog5
-rw-r--r--src/util.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 557de8d..d86820a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-15 Andreas Gruenbacher <agruen@suse.de>
+
+ * 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 <agruen@suse.de>
* 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));
}
}