Don't fail when removing nonexistent files in move_file

This commit is contained in:
Andreas Gruenbacher 2009-06-15 23:31:47 +02:00
parent 6d9e60f59a
commit 4e894668a7
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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));
}
}