MCPcopy Index your code
hub / github.com/RsyncProject/rsync / itemize

Function itemize

generator.c:511–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statret,
512 stat_x *sxp, int32 iflags, uchar fnamecmp_type,
513 const char *xname)
514{
515 if (statret >= 0) { /* A from-dest-dir statret can == 1! */
516 int keep_time = !preserve_mtimes ? 0
517 : S_ISDIR(file->mode) ? !omit_dir_times
518 : S_ISLNK(file->mode) ? !omit_link_times
519 : 1;
520
521 if (S_ISREG(file->mode) && F_LENGTH(file) != sxp->st.st_size)
522 iflags |= ITEM_REPORT_SIZE;
523 if (file->flags & FLAG_TIME_FAILED) { /* symlinks only */
524 if (iflags & ITEM_LOCAL_CHANGE)
525 iflags |= symlink_timeset_failed_flags;
526 } else if (keep_time
527 ? mtime_differs(&sxp->st, file)
528 : iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
529 && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
530 iflags |= ITEM_REPORT_TIME;
531 if (atimes_ndx && !S_ISDIR(file->mode) && !S_ISLNK(file->mode)
532 && !same_time(F_ATIME(file), 0, sxp->st.st_atime, 0))
533 iflags |= ITEM_REPORT_ATIME;
534#ifdef SUPPORT_CRTIMES
535 if (crtimes_ndx) {
536 if (sxp->crtime == 0)
537 sxp->crtime = get_create_time(fnamecmp, &sxp->st);
538 if (!same_time(sxp->crtime, 0, F_CRTIME(file), 0))
539 iflags |= ITEM_REPORT_CRTIME;
540 }
541#endif
542#ifndef CAN_CHMOD_SYMLINK
543 if (S_ISLNK(file->mode)) {
544 ;
545 } else
546#endif
547 if (preserve_perms) {
548 if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
549 iflags |= ITEM_REPORT_PERMS;
550 } else if (preserve_executability
551 && ((sxp->st.st_mode & 0111 ? 1 : 0) ^ (file->mode & 0111 ? 1 : 0)))
552 iflags |= ITEM_REPORT_PERMS;
553 if (uid_ndx && am_root && (uid_t)F_OWNER(file) != sxp->st.st_uid)
554 iflags |= ITEM_REPORT_OWNER;
555 if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
556 iflags |= ITEM_REPORT_GROUP;
557#ifdef SUPPORT_ACLS
558 if (preserve_acls && !S_ISLNK(file->mode)) {
559 if (!ACL_READY(*sxp))
560 get_acl(fnamecmp, sxp);
561 if (set_acl(NULL, file, sxp, file->mode))
562 iflags |= ITEM_REPORT_ACL;
563 }
564#endif
565#ifdef SUPPORT_XATTRS
566 if (preserve_xattrs) {
567 if (!XATTR_READY(*sxp))
568 get_xattr(fnamecmp, sxp);

Callers 4

maybe_hard_linkFunction · 0.85
try_dests_regFunction · 0.85
try_dests_nonFunction · 0.85
recv_generatorFunction · 0.85

Calls 13

mtime_differsFunction · 0.85
same_timeFunction · 0.85
get_create_timeFunction · 0.85
get_aclFunction · 0.85
set_aclFunction · 0.85
get_xattrFunction · 0.85
xattr_diffFunction · 0.85
write_ndxFunction · 0.85
write_shortintFunction · 0.85
write_byteFunction · 0.85
write_vstringFunction · 0.85
send_xattr_requestFunction · 0.85

Tested by

no test coverage detected