On Fri, 6 Nov 2015 16:21:03 +0100 Andreas Henriksson <andr...@fatal.se> wrote:
> Hi again.
>
> On Fri, Nov 06, 2015 at 03:01:08PM +0100, Peter Palfrader wrote:
> [...]
> > But it should work.
> >
> > An "exit 0" at the end, or a "if [ -d ... ]; then rmdir .. ; fi" would
> > also work instead and might be preferable.
>
> Please stop suggesting exit 0. It does not work. Hopefully the attached
> minimal testcase will convince you of this. The final "exit 0" will
> simply never be reached. run: ./foo.sh && echo $?
> (Try also replace 'false' with 'false && true' to more exactly simulate
> your particular bug case.)
>
> (... and even if it was reached, that would certainly throw away
> any exit code - not just the rmdir one.)
>
> rmdir failing is not the end of the world anyway, it's just a
> "lets be nice and clean up if we can" kind of thing.
>
> In your very obscure case that noone else triggered so far there
> is no directory to clean up anyway, so don't worry! :P

For the record, I've triggered this today when upgrading an aarch64
chroot.  Maybe it's not that obscure ;)

Cheers,
Javi

Reply via email to