From: Wayne Davison Date: Sun, 30 Oct 2005 22:28:11 +0000 (+0000) Subject: In the device section, avoid calling unlink() if the stat() failed. X-Git-Tag: v2.6.7pre1~349 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fdb1aa8ffa9b3f1ec225e198461182ad976b010;p=thirdparty%2Frsync.git In the device section, avoid calling unlink() if the stat() failed. --- diff --git a/generator.c b/generator.c index 22a4ce0e..0f53891f 100644 --- a/generator.c +++ b/generator.c @@ -815,7 +815,8 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (statret != 0 || (st.st_mode & ~CHMOD_BITS) != (file->mode & ~CHMOD_BITS) || st.st_rdev != file->u.rdev) { - if (delete_item(fname, st.st_mode, DEL_TERSE) < 0) + if (statret == 0 + && delete_item(fname, st.st_mode, DEL_TERSE) < 0) return; if (preserve_hard_links && file->link_u.links && hard_link_check(file, ndx, fname, -1, &st,