[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH][XEN] Build fix for 64bit



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.