tests: Solaris cmp complains about empty files, even with -s
authorDanek Duvall <danek.duvall@oracle.com>
Wed, 02 Mar 2016 14:58:29 -0800
changeset 28337 869e65e68aee
parent 28336 a5a13eeffc59
child 28338 9974b8236cac
tests: Solaris cmp complains about empty files, even with -s When you compare an empty file, such as /dev/null, with a non-empty file, Solaris cmp complains on stderr with "cmp: EOF on /dev/null", even if the -s argument is present. GNU cmp makes the complaint, but silences it with -s. We can change the pdiff utility to simply redirect stderr to /dev/null so that we don't have to worry about this difference in the test files.
tests/pdiff
--- a/tests/pdiff	Wed Mar 02 14:55:13 2016 -0800
+++ b/tests/pdiff	Wed Mar 02 14:58:29 2016 -0800
@@ -25,7 +25,7 @@
         file2=/dev/null
     fi
 
-    if cmp -s "$file1" "$file2"; then
+    if cmp -s "$file1" "$file2" 2> /dev/null; then
         # Return immediately, because comparison isn't needed. This
         # also avoids redundant message of diff like "No differences
         # encountered" (on Solaris)