Displaying 8 results from an estimated 8 matches for "saveerrno".
Did you mean:
save_errno
2003 Sep 05
1
new option suggestion '--backup-only'
...-02 15:29:03.000000000 +0900
@@ -25,6 +25,7 @@
extern int backup_dir_len;
extern char *backup_suffix;
extern char *backup_dir;
+extern int backup_only;
extern int am_root;
extern int preserve_devices;
@@ -133,21 +134,26 @@
int keep_trying = 4;
int keep_path_extfs = 0;
int failed;
+ int saveerrno;
while (keep_trying) {
- if (keep_path_extfs) {
+ if (keep_path_extfs || backup_only) {
failed = copy_file(src, dst, 0755);
+ saveerrno = errno;
if (!failed) {
do_unlink(src);
+ saveerrno = errno;
}
} else {
failed = robust_rename (src, dst);
+ saveerrno = errno...
2002 Aug 02
1
[patch] --link-dest
...;
+ }
+ if (st->st_uid != file->uid || st->st_gid != file->gid) {
+ return 0;
+ }
+ }
+
/* if always checksum is set then we use the checksum instead
of the file time to determine whether to sync */
@@ -356,6 +366,18 @@
statret = -1;
if (statret == -1)
errno = saveerrno;
+#if HAVE_LINK
+ else if (link_dest && !dry_run) {
+ if (do_link(fnamecmpbuf, fname) != 0) {
+ if (verbose > 0)
+ rprintf(FINFO,"link %s => %s : %s\n",
+ fnamecmpbuf,
+ fname,
+ strerror(errno));
+ }
+ fnamecmp = fnamecmpbuf;
+ }
+#endif
els...
2003 Oct 18
0
Added functionality --compare-file and --compare-auto
...&& (compare_dest != NULL)) {
+ snprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s",
+ compare_dest,fname);
+ compare_file = fnamecmpbuf;
+ }
+
+ if ((statret == -1) && (compare_file != NULL)) {
+ /*try this file instead (--compare-dest, --compare-file, --compare-auto)*/
int saveerrno = errno;
- snprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s",compare_dest,fname);
- statret = link_stat(fnamecmpbuf,&st);
+ statret = link_stat(compare_file,&st);
if (!S_ISREG(st.st_mode))
statret = -1;
if (statret == -1)
errno = saveerrno;
#if HAVE_LINK
else if (link_d...
2005 Jan 05
1
rsync filename heuristics
...int list_only;
> extern int preserve_perms;
> extern int only_existing;
> @@ -341,82 +393,29 @@
> return;
> }
>
> - fnamecmp = fname;
> -
> - if ((statret == -1) && (compare_dest != NULL)) {
> - /* try the file at compare_dest instead */
> - int saveerrno = errno;
> - snprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s",compare_dest,fname);
> - statret = link_stat(fnamecmpbuf,&st);
> - if (!S_ISREG(st.st_mode))
> - statret = -1;
> - if (statret == -1)
> - errno = saveerrno;
> - else
> - fnamecmp = fnamecmpbuf;
>...
2004 Apr 15
0
Multiple compare-dest args
...re_dest[];
extern int list_only;
extern int only_existing;
extern int orig_umask;
@@ -408,11 +408,15 @@
fnamecmp = fname;
- if (statret == -1 && compare_dest != NULL) {
+ if (statret == -1 && compare_dest[0] != NULL) {
/* try the file at compare_dest instead */
int saveerrno = errno;
- pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);
- statret = link_stat(fnamecmpbuf,&st);
+ int i = 0;
+ while (statret == -1 && compare_dest[i] != NULL) {
+ pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest[i], fname);
+ statret = link_stat(fnamecm...
2002 Mar 08
1
[PATCH][RFC] space saving incrementals
...;
+ }
+ if (st->st_uid != file->uid || st->st_gid != file->gid) {
+ return 0;
+ }
+ }
+
/* if always checksum is set then we use the checksum instead
of the file time to determine whether to sync */
@@ -352,6 +363,17 @@
statret = -1;
if (statret == -1)
errno = saveerrno;
+#if HAVE_LINK
+ else if (link_dest)
+ if (do_link(fnamecmpbuf, fname) != 0) {
+ if (verbose > 0)
+ rprintf(FINFO,"link %s => %s : %s\n",
+ fnamecmpbuf,
+ fname,
+ strerror(errno));
+ fnamecmp = fnamecmpbuf;
+ }
+#endif
else
fnamecmp = fnamecmpbuf;
}...
2002 Mar 22
1
[PATCH] --link-dest option
...;
+ }
+ if (st->st_uid != file->uid || st->st_gid != file->gid) {
+ return 0;
+ }
+ }
+
/* if always checksum is set then we use the checksum instead
of the file time to determine whether to sync */
@@ -382,6 +392,17 @@
statret = -1;
if (statret == -1)
errno = saveerrno;
+#if HAVE_LINK
+ else if (link_dest)
+ if (do_link(fnamecmpbuf, fname) != 0) {
+ if (verbose > 0)
+ rprintf(FINFO,"link %s => %s : %s\n",
+ fnamecmpbuf,
+ fname,
+ strerror(errno));
+ fnamecmp = fnamecmpbuf;
+ }
+#endif
else
fnamecmp = fnamecmpbuf;
}...
2002 Aug 05
5
[patch] read-devices
...,fname);
return;
}
if (!S_ISREG(file->mode)) {
- rprintf(FINFO, "skipping non-regular file \"%s\"\n",fname);
- return;
+ if (read_devices && (S_ISFIFO(file->mode) || S_ISBLK(file->mode) || S_ISCHR(file->mode))) {
+ if (verbose > 1) {
+ int saveerrno = errno; /* here and elsewhere -- should be replaced by explicitly saving errno after stat. #ET#XXX */
+ rprintf(FINFO,"%s is a FIFO or device, copying its content to a regular file.\n", f_name(file));
+ errno = saveerrno;
+ }
+ } else {
+ rprintf(FINFO, "skipping non-regu...