autoconf-patches
[Top][All Lists]
Advanced

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

Re: CVS autoconf is broken - one month patch reminder


From: John David Anglin
Subject: Re: CVS autoconf is broken - one month patch reminder
Date: Mon, 25 Sep 2000 11:04:06 -0400 (EDT)

> > > >         autoconf.sh: Change `exit' to `{ (exit 1); exit; }' after m4 and
> > > >         awk commands to ensure exit state is in a defined state.
> 
> By the way, we now have more "exit"s, and we probably want to fix all of
> them.

Any exits which occur before the exit trap is installed are ok as is.

> Anyway, the order of patches is not important. Either fix all exits or 
> apply this patch as is and I'll send a patch for the new exits.
> 
> By the way, adding a comment wouldn't hurt. An paragraph to the
> docucumentation would be nice too. It's not easy to figure out what those
> exits are doing and what systems require this workaround.

This actually already exists.  It was Akim that pointed me to the solution
described in the documentation.  The exit status behaviour of trap 0
varies from shell to shell rather than from system to system.  I believe
that the test failures that I first noted were with the hpux ksh.

You are correct that the trick is not obvious and a comment before the
trap 0 statement in each script wouldn't hurt.  The goal is to have $?
set correctly when the trap is entered.  When trapped, there is variation
from shell to shell in what $? is set to when the form `exit N' is used.
However, `{ (exit N); exit; }' consistently sets $? to N under all shells
which I tried it.  The simple `exit' appears to pass the status of the
previous command correctly under almost all situations.  However, I did
have one failure taken through a simple `exit' which might have been
due to the exit status not being properly copied from the previous
command.  Possibly, it may matter whether the previous command is executed
in a sub-shell or not.  Since the exit states for execution errors in the
various autoconf scripts are not defined, I felt that the form
`{ (exit 1); exit }' might yield a more consistent exit status following
a failed command than just the simple `exit'.

Dave
-- 
J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]