search for: statret

Displaying 20 results from an estimated 43 matches for "statret".

Did you mean: statet
2004 Apr 15
0
Multiple compare-dest args
...!= 0) && compare_dest[i] != NULL) { + pathjoin(fnamecmpdest, sizeof fnamecmpdest, + compare_dest[i], fname); + fname = fnamecmpdest; + i++; } file_checksum(fname,sum,st->st_size); return memcmp(sum, file->u.sum, protocol_version < 21 ? 2 @@ -270,7 +270,7 @@ int statret; char *fnamecmp; char fnamecmpbuf[MAXPATHLEN]; - extern char *compare_dest; + extern char *compare_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 (stat...
2008 Mar 19
0
[PATCH] Unsnarl missing_below/dry_run logic.
...{ + if (dry_run > 1 || (dry_missing_dir && is_below(file, dry_missing_dir))) { + parent_is_dry_missing: if (fuzzy_dirlist) { flist_free(fuzzy_dirlist); fuzzy_dirlist = NULL; @@ -1307,14 +1312,18 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, statret = -1; stat_errno = ENOENT; } else { + dry_missing_dir = NULL; const char *dn = file->dirname ? file->dirname : "."; if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) { if (relative_paths && !implied_dirs - && do_stat(dn, &sx....
2005 Jan 05
1
rsync filename heuristics
...t) > { > if (st->st_size != file->length) { > return 0; > @@ -185,7 +186,61 @@ > return s; > } > > +/* Returns -1 for can't open (null file), -2 for skip */ > +static int open_base_file(struct file_struct *file, > + char *fname, > + int statret, > + STRUCT_STAT *st) > +{ > + int fd = -1; > + > + if (statret == 0) { > + if (S_ISREG(st->st_mode)) { > + if (update_only > + && cmp_modtime(st->st_mtime, file->modtime) > 0) { > + if (verbose > 1) > + rprintf(FINFO,"%...
2004 Aug 06
4
[Bug 1582] rsync dry run cannot find missing folders, contradicts actual run.
https://bugzilla.samba.org/show_bug.cgi?id=1582 ------- Additional Comments From wayned@samba.org 2004-08-05 11:21 ------- Created an attachment (id=594) --> (https://bugzilla.samba.org/attachment.cgi?id=594&action=view) Fix problem with --dry-run (-n) This patch avoids a fatal error when using --dry-run and the destination directory does not exist on the receiver. -- Configure
2003 Oct 18
0
Added functionality --compare-file and --compare-auto
...der the terms of the GNU General Public License as published by @@ -41,6 +42,8 @@ extern int always_checksum; extern int modify_window; extern char *compare_dest; +extern char *compare_file; +extern int compare_auto; extern int link_dest; @@ -357,29 +360,36 @@ fnamecmp = fname; - if ((statret == -1) && (compare_dest != NULL)) { - /* try the file at compare_dest instead */ + if ((statret == -1) && compare_auto) { + compare_file = findcomparename(fname,fnamecmpbuf); + } else if ((statret == -1) && (compare_dest != NULL)) { + snprintf(fnamecmpbuf,MAXPATHLEN,&quot...
2006 Oct 21
1
Rsync 2.6.9pre2 tries to read ACLs of nonexistent files
...erve_acls && real_ret == 0) get_acl(fname, &real_sx); Presumably real_ret is zero if and only if the destination file actually exists. However, back in lines 1210-1226, the generator sets real_ret to 0 if a basis file is found, even though the destination file does not exist: if (statret != 0 && basis_dir[0] != NULL) { int j = try_dests_reg(file, fname, ndx, fnamecmpbuf, &sx, itemizing, maybe_ATTRS_REPORT, code); if (j == -2) { if (remove_source_files == 1) goto return_with_success; goto cleanup; } if (j >= 0) { fnamecmp = fnamecmpbuf;...
2008 May 08
1
Patch to not modify files in place unless "--inplace" option specified
...ANGE; + recreate_symlink: /* Not the right symlink (or not a symlink), so * delete it. */ if (delete_item(fname, sx.st.st_mode, del_opts | DEL_FOR_SYMLINK) != 0) @@ -1572,18 +1583,20 @@ set_file_attrs(fname, file, NULL, NULL, 0); if (itemizing) { itemize(fname, file, ndx, statret, &sx, - ITEM_LOCAL_CHANGE|ITEM_REPORT_CHANGE, 0, NULL); + ITEM_LOCAL_CHANGE|iflags, 0, NULL); } - if (code != FNONE && verbose) + if ((iflags & ITEM_REPORT_CHANGE) && code != FNONE && verbose) rprintf(code, "%s -> %s\n", fname, sl);...
2003 Sep 05
1
new option suggestion '--backup-only'
...c-backuponly/generator.c 2003-09-02 15:44:26.000000000 +0900 @@ -41,6 +41,7 @@ extern int modify_window; extern char *compare_dest; extern int link_dest; +extern int backup_only; /* choose whether to skip a particular file */ @@ -295,6 +296,9 @@ return; } + if (backup_only && statret == -1 && errno == ENOENT) + return; + if (statret == 0 && !preserve_perms && (S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) { @@ -313,6 +317,8 @@ if (dry_run) return; /* XXXX -- might cause inaccuracies?? -- mbp */ if (statret == 0 && !S_ISDI...
2009 Oct 15
1
PATCH: --write-devices to allow synchronising to a block device
...serve_xattrs; extern int preserve_links; extern int preserve_devices; +extern int write_devices; extern int preserve_specials; extern int preserve_hard_links; extern int preserve_executability; @@ -1733,7 +1734,7 @@ fnamecmp = fname; fnamecmp_type = FNAMECMP_FNAME; - if (statret == 0 && !S_ISREG(sx.st.st_mode)) { + if (statret == 0 && !(S_ISREG(sx.st.st_mode) || (write_devices && IS_DEVICE(sx.st.st_mode)))) { if (delete_item(fname, sx.st.st_mode, del_opts | DEL_FOR_FILE) != 0) goto cleanup;...
2004 Sep 02
1
--partiall-dir not behaving like it ought too
Hi, I have awaited the new release inorder to use the -"-partial-dir" option. But after testing it seems that it does not behave like it says on the tin. It will correctly move and rename the interrupted file to the declared directory, but it will not attempt to use it when the client attempts to rsync the file again. I have a Solaris 8 box running as a server (Matthew), and another
2010 Jun 15
3
about rsyncing of block devices
...&& IS_DEVICE(file->mode)))) { if (solo_file) fname = f_name(file, NULL); rprintf(FINFO, "skipping non-regular file \"%s\"\n", fname); @@ -1733,7 +1734,7 @@ static void recv_generator(char *fname, fnamecmp = fname; fnamecmp_type = FNAMECMP_FNAME; - if (statret == 0 && !S_ISREG(sx.st.st_mode)) { + if (statret == 0 && !(S_ISREG(sx.st.st_mode) || (copy_devices && IS_DEVICE(sx.st.st_mode)))) { if (delete_item(fname, sx.st.st_mode, del_opts | DEL_FOR_FILE) != 0) goto cleanup; statret = -1; @@ -1820,6 +1821,26 @@ static void r...
2002 Aug 02
1
[patch] --link-dest
...(file->mode & ~_S_IFMT)) { + return 0; + } + 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)); +...
2015 Nov 28
0
[PATCH] ignore-non-existing-directory: add variant of ignore-non-existing
...int ignore_non_existing; +extern int ignore_non_existing_dirs; extern int want_xattr_optim; extern int inplace; extern int append_mode; @@ -1323,22 +1324,28 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, return; } - if (ignore_non_existing > 0 && statret == -1 && stat_errno == ENOENT) { + if ((ignore_non_existing > 0 || ignore_non_existing_dirs > 0) && statret == -1 && stat_errno == ENOENT) { + int actually_ignore = 0; if (is_dir) { if (is_dir < 0) return; + actually_ignore = 1; skip_dir = file;...
2016 Jan 16
0
[PATCH v2, resend] ignore-non-existing-directory: add variant of ignore-non-existing
...int ignore_non_existing; +extern int ignore_non_existing_dirs; extern int want_xattr_optim; extern int inplace; extern int append_mode; @@ -1323,22 +1324,28 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, return; } - if (ignore_non_existing > 0 && statret == -1 && stat_errno == ENOENT) { + if ((ignore_non_existing > 0 || ignore_non_existing_dirs > 0) && statret == -1 && stat_errno == ENOENT) { + int actually_ignore = 0; if (is_dir) { if (is_dir < 0) return; + actually_ignore = 1; skip_dir = file;...
2015 Nov 28
0
[PATCH v2] ignore-non-existing-directory: add variant of ignore-non-existing
...int ignore_non_existing; +extern int ignore_non_existing_dirs; extern int want_xattr_optim; extern int inplace; extern int append_mode; @@ -1323,22 +1324,28 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, return; } - if (ignore_non_existing > 0 && statret == -1 && stat_errno == ENOENT) { + if ((ignore_non_existing > 0 || ignore_non_existing_dirs > 0) && statret == -1 && stat_errno == ENOENT) { + int actually_ignore = 0; if (is_dir) { if (is_dir < 0) return; + actually_ignore = 1; skip_dir = file;...
2016 Jun 13
0
[PATCH v8 2/3] New API: filesystem_walk
...+ +/* Deserialise the file content and populate the dirent list. + * Return the number of deserialised dirents, -1 on error. + */ +static int +deserialise_dirent_list (guestfs_h *g, FILE *fp, + struct guestfs_tsk_dirent_list *dirents) +{ + XDR xdr; + bool_t ret = 0; + int statret = 0; + uint32_t index = 0; + struct stat statbuf; + + statret = fstat (fileno(fp), &statbuf); + if (statret == -1) + return -1; + + xdrstdio_create (&xdr, fp, XDR_DECODE); + + for (index = 0; xdr_getpos (&xdr) < statbuf.st_size; index++) { + if (index == dirents->len)...
2002 Apr 03
3
metadata in dryrun mode
As I reported a while back rsync doesn't handle metadata (permissions and ownership) in dryrun mode. I offered to make a patch and that offer still stands. I didn't have the time for it until now and want to pick it up again. I had some ugly hack back then but I want to redo it in a clean way. I would like some input on my thoughts. IMHO, it would be ideally if the check for dry_run
2002 Aug 05
5
[patch] read-devices
...n", i,(double)s->sums[i].offset,s->sums[i].len,s->sums[i].sum1); - len -= n1; - offset += n1; + len -= buf->m_len; + offset += buf->m_len; } return s; } @@ -245,8 +246,9 @@ if (verbose > 2) rprintf(FINFO,"recv_generator(%s,%d)\n",fname,i); statret = link_stat(fname,&st); + { int errsave=errno; rprintf(FINFO, "#ET# recv_generator: statret==%d, errno=%d\n", statret, errno); errno=errsave; } if (only_existing && statret == -1 && errno == ENOENT) { /* we only want to update existing files */ if (verbose &g...
2002 Apr 23
1
patch: timeout problem solved
...ms[i].len,s->sums[i].sum1); + i,(double)offset,n1,sum1); + write_int(f_out, sum1); + write_buf(f_out, &sum2[0], csum_length); len -= n1; offset += n1; } - - return s; } @@ -230,7 +200,6 @@ int fd; STRUCT_STAT st; struct map_struct *buf; - struct sum_struct *s; int statret; struct file_struct *file = flist->files[i]; char *fnamecmp; @@ -389,7 +358,7 @@ if (statret == -1) { if (errno == ENOENT) { write_int(f_out,i); - if (!dry_run) send_sums(NULL,f_out); + if (!dry_run) send_null_sums(f_out); } else { if (verbose > 1) rprintf(FERROR,...
2011 Dec 16
1
[Bug 8665] New: Crash in free_xattr(), from recv_generator()
...ile into the set) and I haven't yet been able to reduce it to a simple test case. But looking through the code there's an obvious issue. In generator.c recv_generator(), with just a few lines removed for clarity, we have: recv_generator() { ... 1373: itemize(fnamecmp, file, ndx, statret, &sx, statret ? ITEM_LOCAL_CHANGE : 0, 0, NULL); ... 1657: real_sx = sx; ... 1837: free_xattr(&real_sx); ... 1892: free_xattr(&sx); ... } With xattrs in play, the itemize() ends up mallocing bits of memory and attaching it to sx.xattr....