From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27026 invoked from network); 28 May 2001 06:50:35 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 May 2001 06:50:35 -0000 Received: (qmail 5075 invoked by alias); 28 May 2001 06:50:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14501 Received: (qmail 5056 invoked from network); 28 May 2001 06:50:15 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "ZSH Workers Mailing List" Subject: Re: PATCH: Block device tests Date: Mon, 28 May 2001 10:50:09 +0400 Message-ID: <000701c0e742$6f9f1bd0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: <1010527225420.ZM1568@candle.brasslantern.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 > > Not finding any block (or character) devices because /dev is inaccessible > to nonprivileged users -- which has been the cause of at least a few of > the device test failures reported -- is not the same as "not implemented" > (which is presumably the issue with mkfifo on ReliantUNIX). > It is on Cygwin. > > Could we use a grep of config.h as the not-implemented test? > Yes; this does it for mkfifo test. For procsubst we need to skip the whole file (not just a single test) - I cannot see how to do it currently (the grep shuold be for HAVE_FIFOS or HAVE_PATH_FD). There are still problems under Cygwin - there is no reliable way to mark a file as executable. At least, I cannot think about one offhand. -andrej Index: Test/C02cond.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v retrieving revision 1.5 diff -u -r1.5 C02cond.ztst --- Test/C02cond.ztst 2001/05/26 08:41:02 1.5 +++ Test/C02cond.ztst 2001/05/28 06:46:31 @@ -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,12 +68,17 @@ [[ -o rcs && ! -o norcs && -o noerrexit && ! -o errexit ]] 0:-o cond - if whence mkfifo >/dev/null; then - mkfifo pipe + if ! grep '#define HAVE_FIFOS' ../../config.h > /dev/null 2>&1; then + print -u8 'Warning: Not testing [[ -p pipe ]] (FIFOs not supported)' + [[ ! -p zerolength ]] else - mknod pipe p + if whence mkfifo >/dev/null; then + mkfifo pipe + else + mknod pipe p + fi + [[ ( $nopipe == true || -p pipe ) && ! -p zerolength ]] fi - [[ -p pipe && ! -p zerolength ]] 0:-p cond [[ -r zerolength && ! -r unmodish ]]