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

Function get_xattr

xattrs.c:304–334  ·  view source on GitHub ↗

Read the xattr(s) for this filename. */

Source from the content-addressed store, hash-verified

302
303/* Read the xattr(s) for this filename. */
304int get_xattr(const char *fname, stat_x *sxp)
305{
306 sxp->xattr = new(item_list);
307 *sxp->xattr = empty_xattr;
308
309 if (S_ISREG(sxp->st.st_mode) || S_ISDIR(sxp->st.st_mode)) {
310 /* Everyone supports this. */
311 } else if (S_ISLNK(sxp->st.st_mode)) {
312#ifndef NO_SYMLINK_XATTRS
313 if (!preserve_links)
314#endif
315 return 0;
316 } else if (IS_SPECIAL(sxp->st.st_mode)) {
317#ifndef NO_SPECIAL_XATTRS
318 if (!preserve_specials)
319#endif
320 return 0;
321 } else if (IS_DEVICE(sxp->st.st_mode)) {
322#ifndef NO_DEVICE_XATTRS
323 if (!preserve_devices)
324#endif
325 return 0;
326 } else if (IS_MISSING_FILE(sxp->st))
327 return 0;
328
329 if (rsync_xal_get(fname, sxp->xattr) < 0) {
330 free_xattr(sxp);
331 return -1;
332 }
333 return 0;
334}
335
336int copy_xattrs(const char *source, const char *dest)
337{

Callers 6

hard_link_checkFunction · 0.85
copy_valid_pathFunction · 0.85
make_backupFunction · 0.85
send_file_nameFunction · 0.85
xattrs_differFunction · 0.85
itemizeFunction · 0.85

Calls 2

rsync_xal_getFunction · 0.85
free_xattrFunction · 0.70

Tested by

no test coverage detected