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][XEN] Build fix for 64bit

To: Christoph Egger <Christoph.Egger@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH][XEN] Build fix for 64bit
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Tue, 3 Jun 2008 17:00:54 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 03 Jun 2008 09:01:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200806031748.26842.Christoph.Egger@xxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Newsgroups: chiark.mail.xen.devel
References: <200806031748.26842.Christoph.Egger@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Christoph Egger writes ("[Xen-devel] [PATCH][XEN] Build fix for 64bit"):
> The sh manpage for option -e says:
> 
>            -e errexit       If not interactive, exit immediately if
>                             any untested command fails.  The exit
>                             status of a com- mand is considered to
>                             be explicitly tested if the command is
>                             used to control an if, elif, while, or
>                             until; or if the command is the left
>                             hand operand of an ``&&'' or ``||''
>                             operator.

This description isn't quite relevant for the code fragment

> -test -x /usr/xpg4/bin/sed && SED=/usr/xpg4/bin/sed

since here test _is_ the left hand operand of &&.

But I think that NetBSD's behaviour here is arguably defensible,
because an alternative reasonable interpretation of a && b in the
context of set -e is that _both_ commands must succeed.

On the other hand, NetBSD's behaviour is not according to its own
documentation and also in contravention of SuSv3, whose section
  http://www.opengroup.org/onlinepubs/009695399/utilities/set.html
says about set -e:
  if a simple command fails for any of the reasons listed in
  Consequences of Shell Errors or returns an exit status value >0, and
  is not part of the compound list following a while, until, or if
  keyword, and is not a part of an AND or OR list
and of course `test' is a `simple command' as defined.

So I think your patch should be applied to Xen but you should also
report a bug to NetBSD, for them to fix either their documentation or
their code.

Ian.

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

<Prev in Thread] Current Thread [Next in Thread>