static struct delete_list {
dev_t dev;
- ino_t inode;
+ INO_T inode;
} *delete_list;
static int dlist_len, dlist_alloc_len;
if (errno == EXDEV) {
/* rename failed on cross-filesystem link.
Copy the file instead. */
- if (copy_file(fnametmp,fname, file->mode)) {
+ if (copy_file(fnametmp,fname, file->mode & ACCESSPERMS)) {
rprintf(FERROR,"copy %s -> %s : %s\n",
fnametmp,fname,strerror(errno));
} else {
if (!get_tmpname(fnametmp,fname)) {
if (buf) unmap_file(buf);
- close(fd1);
+ if (fd1 != -1) close(fd1);
continue;
}
rprintf(FERROR,"mktemp %s failed\n",fnametmp);
receive_data(f_in,buf,-1,NULL,file->length);
if (buf) unmap_file(buf);
- close(fd1);
+ if (fd1 != -1) close(fd1);
continue;
}
rprintf(FERROR,"open %s : %s\n",fnametmp,strerror(errno));
receive_data(f_in,buf,-1,NULL,file->length);
if (buf) unmap_file(buf);
- close(fd1);
+ if (fd1 != -1) close(fd1);
continue;
}