Read the xattr(s) for this filename. */
| 302 | |
| 303 | /* Read the xattr(s) for this filename. */ |
| 304 | int 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 | |
| 336 | int copy_xattrs(const char *source, const char *dest) |
| 337 | { |
no test coverage detected