Simplify the setting of rdev & rdev_high in send_file_entry().
[rsync/rsync.git] / testsuite / devices.test
index 70f4f94..ca186eb 100644 (file)
@@ -16,6 +16,12 @@ set -x
 fromdir="$scratchdir/from"
 todir="$scratchdir/to"
 
+case `id -u` in
+'') ;; # If "id" failed, try to continue...
+0) ;;
+*) test_skipped "Rsync won't copy devices unless we're root" ;;
+esac
+
 # TODO: Need to test whether hardlinks are possible on this OS/filesystem
 
 mkdir "$fromdir"
@@ -26,6 +32,5 @@ mknod "$fromdir/block3" b 105 73 || test_skipped "Can't create block device node
 
 checkit "$RSYNC -aHvv \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
 
+# The script would have aborted on error, so getting here means we've won.
 exit 0
-# last [] may have failed but if we get here then we've won
-