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

Function send_file_entry

flist.c:392–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static void send_file_entry(int f, const char *fname, struct file_struct *file,
393#ifdef SUPPORT_LINKS
394 const char *symlink_name, int symlink_len,
395#endif
396 int ndx, int first_ndx)
397{
398 static time_t modtime, atime;
399#ifdef SUPPORT_CRTIMES
400 static time_t crtime;
401#endif
402 static mode_t mode;
403#ifdef SUPPORT_HARD_LINKS
404 static int64 dev;
405#endif
406 static dev_t rdev;
407 static uint32 rdev_major;
408 static uid_t uid;
409 static gid_t gid;
410 static const char *user_name, *group_name;
411 static char lastname[MAXPATHLEN];
412#ifdef SUPPORT_HARD_LINKS
413 int first_hlink_ndx = -1;
414#endif
415 int l1, l2;
416 int xflags;
417
418 /* Initialize starting value of xflags and adjust counts. */
419 if (S_ISREG(file->mode))
420 xflags = 0;
421 else if (S_ISDIR(file->mode)) {
422 stats.num_dirs++;
423 if (protocol_version >= 30) {
424 if (file->flags & FLAG_CONTENT_DIR)
425 xflags = file->flags & FLAG_TOP_DIR;
426 else if (file->flags & FLAG_IMPLIED_DIR)
427 xflags = XMIT_TOP_DIR | XMIT_NO_CONTENT_DIR;
428 else
429 xflags = XMIT_NO_CONTENT_DIR;
430 } else
431 xflags = file->flags & FLAG_TOP_DIR; /* FLAG_TOP_DIR == XMIT_TOP_DIR */
432 } else {
433 if (S_ISLNK(file->mode))
434 stats.num_symlinks++;
435 else if (IS_DEVICE(file->mode))
436 stats.num_devices++;
437 else if (IS_SPECIAL(file->mode))
438 stats.num_specials++;
439 xflags = 0;
440 }
441
442 if (file->mode == mode)
443 xflags |= XMIT_SAME_MODE;
444 else
445 mode = file->mode;
446
447 if (preserve_devices && IS_DEVICE(mode)) {
448 if (protocol_version < 28) {
449 if (tmp_rdev == rdev)

Callers 1

send_file_nameFunction · 0.85

Calls 15

add_uidFunction · 0.85
add_gidFunction · 0.85
idev_findFunction · 0.85
big_numFunction · 0.85
write_varintFunction · 0.85
write_shortintFunction · 0.85
write_byteFunction · 0.85
write_varint30Function · 0.85
write_bufFunction · 0.85
write_varlong30Function · 0.85
write_varlongFunction · 0.85
write_intFunction · 0.85

Tested by

no test coverage detected