From 089275cd12bad51b6960f21a6431690bdbe7565a Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 28 May 2001 16:33:54 +0000 Subject: More device and FIFO test tweaks. --- Test/C02cond.ztst | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'Test') diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst index aabbbf23a..28305795f 100644 --- a/Test/C02cond.ztst +++ b/Test/C02cond.ztst @@ -27,7 +27,7 @@ 0:-a cond # Find a block special file system. This is a little tricky. - block=$(find /dev(|ices)/ -type b -print 2> /dev/null) + block=$(find /dev(|ices)/ -type b -print) if [[ -n $block ]]; then [[ -b $block[(f)1] && ! -b zerolength ]] else @@ -36,8 +36,9 @@ fi 0D:-b cond - char=(/dev/tty*([1])) - [[ -c $char && ! -c $block ]] + # Use hardcoded /dev/tty because globbing inside /dev fails on Cygwin + char=/dev/tty + [[ -c $char && ! -c $zerolength ]] 0:-c cond [[ -d . && ! -d zerolength ]] @@ -67,13 +68,18 @@ [[ -o rcs && ! -o norcs && -o noerrexit && ! -o errexit ]] 0:-o cond - if whence mkfifo >/dev/null; then - mkfifo pipe + if ! grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h; then + print -u8 'Warning: Not testing [[ -p pipe ]] (FIFOs not supported)' + [[ ! -p zerolength ]] else - mknod pipe p + if whence mkfifo && mkfifo pipe || mknod pipe p; then + [[ -p pipe && ! -p zerolength ]] + else + print -u8 'Warning: Not testing [[ -p pipe ]] (cannot create FIFO)' + [[ ! -p zerolength ]] + fi fi - [[ -p pipe && ! -p zerolength ]] -0:-p cond +0dD:-p cond [[ -r zerolength && ! -r unmodish ]] 0:-r cond -- cgit 1.4.1