Commit 0fdb1aa8 authored by Wayne Davison's avatar Wayne Davison

In the device section, avoid calling unlink() if the stat() failed.

parent bad01106
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment