mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
sh_done(): fix portable exit status logic (re: d024d4c8
)
"savxit -= SH_EXITSIG + 128;" may have worked accidentally due to subsequent bitmasking, but is blatantly wrong . It subtracts 256 + 128 = 384 from the exit status. Use bitwise logic instead, with an octal literal 0200 instead of 128. This makes more sense in this context.
This commit is contained in:
parent
aacf0d0b66
commit
44438725b1
1 changed files with 1 additions and 1 deletions
|
@ -677,7 +677,7 @@ void sh_done(void *ptr, register int sig)
|
|||
|
||||
/* Exit with portable 8-bit status (128 + signum) if last child process exits due to signal */
|
||||
if (savxit & SH_EXITSIG)
|
||||
savxit -= SH_EXITSIG + 128;
|
||||
savxit = savxit & ~SH_EXITSIG | 0200;
|
||||
|
||||
exit(savxit&SH_EXITMASK);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue