+
+ # If we can't test the real device code, try to test --fake-super instead
+ $RSYNC --version | grep ", xattrs" >/dev/null || test_skipped "Rsync needs root/fakeroot/--fake-super for device tests"
+ RSYNC="$RSYNC --fake-super"
+ export RSYNC_FAKE_SUPER=1
+ case "`xattr 2>&1`" in
+ *--list:*)
+ mknod() {
+ fn="$1"
+ case "$2" in
+ p) mode=10644 ;;
+ c) mode=20644 ;;
+ b) mode=60644 ;;
+ esac
+ maj="${3:-0}"
+ min="${4:-0}"
+ touch "$fn"
+ xattr -s 'rsync.%stat' "$mode $maj,$min 0:0" "$fn"
+ }
+ ;;
+ *)
+ mknod() {
+ fn="$1"
+ case "$2" in
+ p) mode=10644 ;;
+ c) mode=20644 ;;
+ b) mode=60644 ;;
+ esac
+ maj="${3:-0}"
+ min="${4:-0}"
+ touch "$fn"
+ setfattr -n 'user.rsync.%stat' -v "$mode $maj,$min 0:0" "$fn"
+ }
+ ;;
+ esac