From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26988 invoked from network); 26 Mar 2008 15:51:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Mar 2008 15:51:45 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 11011 invoked from network); 26 Mar 2008 15:51:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2008 15:51:40 -0000 Received: (qmail 15051 invoked by alias); 26 Mar 2008 15:51:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24746 Received: (qmail 15031 invoked from network); 26 Mar 2008 15:51:36 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Mar 2008 15:51:36 -0000 Received: from puffy.raveland.org (puffy.raveland.org [195.200.166.230]) by bifrost.dotsrc.org (Postfix) with ESMTP id 13BD38097826 for ; Wed, 26 Mar 2008 16:51:32 +0100 (CET) Received: from coredump.raveland.priv (bofh.pacwan.net [195.200.191.36]) by puffy.raveland.org (Postfix) with ESMTP id 71CA1713466; Wed, 26 Mar 2008 16:51:31 +0100 (CET) Date: Wed, 26 Mar 2008 16:51:28 +0100 From: Pea To: Peter Stephenson Cc: Baptiste Daroussin , zsh-workers@sunsite.dk Subject: Re: _canonical_path not working on *BSD Message-ID: <20080326165128.5b368e99@coredump.raveland.priv> In-Reply-To: <200803261534.m2QFY9L1017279@news01.csr.com> References: <20080326114413.80713vrmznwpnyuc@bapt.selfip.org> <20080326150552.52b3f1c4@news01> <20080326162710.20476ooqf5nlulwc@bapt.selfip.org> <200803261534.m2QFY9L1017279@news01.csr.com> Organization: Raveland X-Mailer: Claws Mail 3.3.0 (GTK+ 2.12.7; i386-unknown-openbsd4.3) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.91.2/6396/Wed Mar 26 12:29:12 2008 on bifrost X-Virus-Status: Clean Le Wed, 26 Mar 2008 15:34:09 +0000, Peter Stephenson a =E9crit : > Baptiste Daroussin wrote: > > This only work on OpenBSD, readlink on FreeBSD doesn't allow -f. >=20 > I think that means the function won't do what it's designed to do, > right? So in that case we should test if readlink accepts -f and if > it doesn't, then return immediately. However, that may not be a > trivial test. How about something like >=20 > [[ -n $(readlink -f / 2>&1 >/dev/null) ]] >=20 > (for which we could cache the result)? Or is testing that > "readlink -f / >&/dev/null" returns status 0 good enough? >=20 On OpenBSD: [pea@coredump:~]% readlink -f / >&/dev/null ; echo $? 0 But readlink -f exists on netbsd only since release 4.0. Older release doesn't have this option. Regards.