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

d-l error handling



On Sun, Nov 04, 2007 at 01:54:31PM -0500, Justin Pryzby wrote:
> On Fri, Nov 02, 2007 at 06:46:50PM -0400, Justin Pryzby wrote:
> > I just realized the reason for d-l poor error handling:
> > 
> > /usr/share/live-helper/functions/lockfile.sh:
> > trap "test -f ${FILE} && rm -f ${FILE}; exit 0" 0 1 2 3 9 15
> > 
> > This exit 0 happens in the helper helper so callers don't notice the
> > error.
> > 
> > My naive though is that the trap should be:
> > trap 'ret=$?; '"rm -f \"${FILE}\";"' exit $ret' EXIT
> > 
> > IIRC this works around broken shells or ambiguity about the return
> > value of the shell process after ret (is it the value of $? on
> > entering the trap, or after running the trap commands?)
> I just tested with this change and succeeded in built an image.  The
> 2>&1 |tee binary.log differs only in insignificant ways.
Comments, please?



Reply to: