From a3e2a92f9d2f74b36a5cb8e67696025c7273e129 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 26 Feb 2001 22:05:51 +0000 Subject: [PATCH] * autoupdate.in: Preserve exit status of the failed command when die() follows system() by dividing $! by 256. --- ChangeLog | 5 +++++ autoupdate.in | 4 ++-- autoupdate.sh | 4 ++-- bin/autoupdate.in | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 282c7451..bdbbf0fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-02-26 Pavel Roskin + + * autoupdate.in: Preserve exit status of the failed command when + die() follows system() by dividing $! by 256. + 2001-02-26 Akim Demaille * acgeneral.m4 (AH_VERBATIM, AH_TEMPLATE): New, use AS_ESCAPE, not diff --git a/autoupdate.in b/autoupdate.in index c136347b..867834b9 100644 --- a/autoupdate.in +++ b/autoupdate.in @@ -461,8 +461,8 @@ EOF if $verbose; if (system ("$m4 $tmp/input.m4 >$tmp/updated")) { - # FIXME: This guy is supposed to exit with a proper - # exit status, but it does not. Help is needed. + # Exit status of system() is in the upper byte. + $! >>= 8; die "$me: cannot update \`$filename'\n"; }; diff --git a/autoupdate.sh b/autoupdate.sh index c136347b..867834b9 100644 --- a/autoupdate.sh +++ b/autoupdate.sh @@ -461,8 +461,8 @@ EOF if $verbose; if (system ("$m4 $tmp/input.m4 >$tmp/updated")) { - # FIXME: This guy is supposed to exit with a proper - # exit status, but it does not. Help is needed. + # Exit status of system() is in the upper byte. + $! >>= 8; die "$me: cannot update \`$filename'\n"; }; diff --git a/bin/autoupdate.in b/bin/autoupdate.in index c136347b..867834b9 100644 --- a/bin/autoupdate.in +++ b/bin/autoupdate.in @@ -461,8 +461,8 @@ EOF if $verbose; if (system ("$m4 $tmp/input.m4 >$tmp/updated")) { - # FIXME: This guy is supposed to exit with a proper - # exit status, but it does not. Help is needed. + # Exit status of system() is in the upper byte. + $! >>= 8; die "$me: cannot update \`$filename'\n"; };