return;
}
-#if SUPPORT_LINKS
if (preserve_links && S_ISLNK(file->mode)) {
+#if SUPPORT_LINKS
char lnk[MAXPATHLEN];
int l;
if (statret == 0) {
fprintf(FINFO,"%s -> %s\n",
fname,file->link);
}
+#endif
return;
}
-#endif
#ifdef HAVE_MKNOD
if (am_root && preserve_devices && IS_DEVICE(file->mode)) {
/* open tmp file */
if (strlen(fname) > (MAXPATHLEN-8)) {
fprintf(FERROR,"filename too long\n");
+ close(fd1);
continue;
}
sprintf(fnametmp,"%s.XXXXXX",fname);
continue;
}
fd2 = open(fnametmp,O_WRONLY|O_CREAT,file->mode);
- if (relative_paths && errno == ENOENT &&
+ if (fd2 == -1 && relative_paths && errno == ENOENT &&
create_directory_path(fnametmp) == 0) {
fd2 = open(fnametmp,O_WRONLY|O_CREAT,file->mode);
}
/* map the local file */
if (fstat(fd,&st) != 0) {
fprintf(FERROR,"fstat failed : %s\n",strerror(errno));
+ close(fd);
return -1;
}