[Top][All Lists]

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

Re: 39-exit-status.patch

From: Pavel Roskin
Subject: Re: 39-exit-status.patch
Date: Mon, 26 Feb 2001 11:08:07 -0500 (EST)

Hello, Akim!

> I don't know what to do, I tried many things, but systematically
> failed :(  The idea is that
>      if (system ("$m4 $tmp/input.m4 >$tmp/updated"))
>         {
>        die "$me: cannot update \`$filename'\n";
>         };

How about this:

        * Preserve exit status of the failed command
        when dying after system() by dividing $! by 256.

@@ -461,8 +461,8 @@
        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";


It works just fine for me. The documentation for system() (man perlfunc)
says that the error status is in the upper byte,

I'm sure that unlink and rmdir in &END have nothing to do with the

Pavel Roskin

reply via email to

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