]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use binmode
authorMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 11:56:07 +0000 (11:56 +0000)
committerMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 11:56:07 +0000 (11:56 +0000)
bin/tests/system/masterformat/tests.sh

index 7066714d5c868befa9d3a0331919c0b85aba13b5..7ee16821a3add2b4f70682b60c918e99a9c24fc4 100755 (executable)
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.9 2011/12/22 07:32:40 each Exp $
+# $Id: tests.sh,v 1.10 2011/12/22 11:56:07 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
 israw () {
-    perl -e '$input = <STDIN>;
+    perl -e 'binmode STDIN;
+             read(STDIN, $input, 8);
              ($style, $version) = unpack("NN", $input);
              exit 1 if ($style != 2 || $version > 1);' < $1
     return $?
 }
 
 rawversion () {
-    perl -e '$input = <STDIN>;
+    perl -e 'binmode STDIN;
+             read(STDIN, $input, 8);
              if (length($input) < 8) { print "not raw\n"; exit 0; };
              ($style, $version) = unpack("NN", $input);
              print ($style == 2 ? "$version\n" : "not raw\n");' < $1
 }
 
 sourceserial () {
-    perl -e '$input = <STDIN>;
+    perl -e 'binmode STDIN;
+             read(STDIN, $input, 20);
              if (length($input) < 20) { print "UNSET\n"; exit; };
              ($format, $version, $dumptime, $flags, $sourceserial) = 
                      unpack("NNNNN", $input);