From: Paul Eggert Date: Thu, 12 Aug 2004 17:24:16 +0000 (+0000) Subject: (END): Return correct exit status even X-Git-Tag: AUTOCONF-2.59c~661 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b92feaac1f30de73bb48c9b81ef9cfe01428c525;p=thirdparty%2Fautoconf.git (END): Return correct exit status even if unlink succeeds and sets $?. Needed with Solaris 8's perl 5.00503. --- diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm index 6b5c584c3..5cbf2a388 100644 --- a/lib/Autom4te/General.pm +++ b/lib/Autom4te/General.pm @@ -1,5 +1,5 @@ # autoconf -- create `configure' using m4 macros -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -183,7 +183,8 @@ sub END # this sets $? = 255 # # Cases 1), 2), and 3b) are fine, but we prefer $? = 1 for 3a) and 3c). - $? = 1 if ($! && $! == $?) || $? == 255; + my $status = $?; + $status = 1 if ($! && $! == $?) || $? == 255; # (Note that we cannot safely distinguish calls to `exit (n)' # from calls to die when `$! = n'. It's not big deal because # we only call `exit (0)' or `exit (1)'.) @@ -215,6 +216,8 @@ sub END $? = 1; return; } + + $? = $status; }