fix by Jie Zhang for exit status and POSIX compliance:
authorMike Frysinger <vapier@gentoo.org>
Wed, 14 May 2008 11:51:04 +0000 (11:51 -0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 14 May 2008 11:51:04 +0000 (11:51 -0000)
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
The exit status of a command that terminated because it received a signal shall be reported as greater than 128.

shell/msh.c

index a96e799e2a66ee9a16dab3b98ef8191fccc8b5f1..aa6fb1d2613acdce30237ae398b6a51bc2b233d3 100644 (file)
@@ -3007,7 +3007,7 @@ static int waitfor(int lastpid, int canintr)
                                        prs(" - core dumped");
                                if (rv >= ARRAY_SIZE(signame) || signame[rv])
                                        prs("\n");
-                               rv = -1;
+                               rv |= 0x80;
                        } else
                                rv = WAITVAL(s);
                }