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

Function send1extra

flist.c:2046–2110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2044}
2045
2046static void send1extra(int f, struct file_struct *file, struct file_list *flist)
2047{
2048 char fbuf[MAXPATHLEN];
2049 item_list *relname_list;
2050 int len, dlen, flags = FLAG_DIVERT_DIRS | FLAG_CONTENT_DIR;
2051 size_t j;
2052
2053 f_name(file, fbuf);
2054 dlen = strlen(fbuf);
2055
2056 if (!change_pathname(file, NULL, 0))
2057 exit_cleanup(RERR_FILESELECT);
2058
2059 change_local_filter_dir(fbuf, dlen, send_dir_depth);
2060
2061 if (file->flags & FLAG_CONTENT_DIR) {
2062 if (one_file_system) {
2063 STRUCT_STAT st;
2064 if (link_stat(fbuf, &st, copy_dirlinks) != 0) {
2065 interpret_stat_error(fbuf, True);
2066 return;
2067 }
2068 filesystem_dev = st.st_dev;
2069 }
2070 send_directory(f, flist, fbuf, dlen, flags);
2071 }
2072
2073 if (!relative_paths)
2074 return;
2075
2076 memcpy(&relname_list, F_DIR_RELNAMES_P(file), sizeof relname_list);
2077 if (!relname_list)
2078 return;
2079
2080 for (j = 0; j < relname_list->count; j++) {
2081 char *slash;
2082 relnamecache *rnp = ((relnamecache**)relname_list->items)[j];
2083 char name_type = rnp->name_type;
2084
2085 fbuf[dlen] = '/';
2086 len = strlcpy(fbuf + dlen + 1, rnp->fname, sizeof fbuf - dlen - 1);
2087 free(rnp);
2088 if (len >= (int)sizeof fbuf)
2089 continue; /* Impossible... */
2090
2091 slash = strchr(fbuf+dlen+1, '/');
2092 if (slash) {
2093 send_implied_dirs(f, flist, fbuf, fbuf+dlen+1, slash, flags, name_type);
2094 continue;
2095 }
2096
2097 if (name_type != NORMAL_NAME) {
2098 STRUCT_STAT st = {0};
2099
2100 if (name_type != MISSING_NAME && link_stat(fbuf, &st, 1) != 0) {
2101 interpret_stat_error(fbuf, True);
2102 continue;
2103 }

Callers 1

send_extra_file_listFunction · 0.85

Calls 9

f_nameFunction · 0.85
change_pathnameFunction · 0.85
change_local_filter_dirFunction · 0.85
link_statFunction · 0.85
interpret_stat_errorFunction · 0.85
send_directoryFunction · 0.85
strlcpyFunction · 0.85
send_implied_dirsFunction · 0.85
send_file_nameFunction · 0.85

Tested by

no test coverage detected