WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Fix xencommons for NetBSD

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix xencommons for NetBSD
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Fri, 15 Jul 2011 12:56:56 +0100
Cc: Roger Pau Monné <roger.pau@xxxxxxxxxxxxx>, Egger <Christoph.Egger@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Christoph
Delivery-date: Fri, 15 Jul 2011 05:06:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110715114407.GA17857@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <CAPLaKK7siKth90wyjh465CVnmbDhFMZs3tLe_=fhuOjy2CmANQ@xxxxxxxxxxxxxx> <1310716893.634.552.camel@xxxxxxxxxxxxxxxxxxxxxx> <4E200171.5080700@xxxxxxx> <1310721214.634.561.camel@xxxxxxxxxxxxxxxxxxxxxx> <CAPLaKK5vbmF2GdDM1xz3R7-5+OMVTomaUv5zey0oYob=kVsDdg@xxxxxxxxxxxxxx> <1310722858.634.573.camel@xxxxxxxxxxxxxxxxxxxxxx> <CAPLaKK4dLuUfjsxPohcArTRV+eV6RU2ARqAHGkyy6bZL_c2BWQ@xxxxxxxxxxxxxx> <1310724488.634.577.camel@xxxxxxxxxxxxxxxxxxxxxx> <CAPLaKK5Q4T39NFUT5g91L9p7Sj5oKg8zKPVs+QaqwBKqBPQ7dg@xxxxxxxxxxxxxx> <20110715114407.GA17857@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2011-07-15 at 12:44 +0100, Olaf Hering wrote:
> On Fri, Jul 15, Roger Pau Monné wrote:
> 
> > Another one, used -n instead of -z when testing the presence of
> > XENSTORED_ROOTDIR. Sorry for this mess, I'm not really used to make
> > shell init scripts.
> 
> +       xenstored_pid=$(check_pidfile ${XENSTORED_PIDFILE} 
> ${SBINDIR}/xenstored)
> +       if test -z $xenstored_pid; then
> 
> Doesnt this expand to 'if test -z ; then' if check_pidfile returns
> nothing, causing a shell syntax error?

Seems not:
$ dash -c 'if test -z ; then echo foo ; fi'
foo
$ posh -c 'if test -z ; then echo foo ; fi'
foo

(maybe NetBSD sh(1) or test(1) differs though)

> Better do 'if test -z "$variable" ; then'.

That's still good advice IMHO.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel