mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-26 15:29:07 +00:00
kill: fix signal number to name lookup on AIX
* src/operand2sig.c (operand2sig): AIX uses a different bit pattern in the returned status from the wait() functions and from shells. Therefore hardcode the selection of the lower bits of the number. * NEWS: Mention the fix.
This commit is contained in:
parent
45d1957ce8
commit
900b5621e6
4
NEWS
4
NEWS
@ -41,6 +41,10 @@ GNU coreutils NEWS -*- outline -*-
|
||||
Now, it prints a diagnostic or a line to stdout for each argument.
|
||||
[bug introduced in the bourne-shell-to-C rewrite for coreutils-6.11]
|
||||
|
||||
kill now converts from number to signal name correctly on AIX.
|
||||
Previously it would have always returned the 'EXIT' name.
|
||||
[bug introduced in fileutils-4.1.9]
|
||||
|
||||
split no longer exits when invocations of a --filter return EPIPE.
|
||||
[bug introduced in coreutils-8.26]
|
||||
|
||||
|
||||
@ -53,8 +53,15 @@ operand2sig (char const *operand, char *signame)
|
||||
char *endp;
|
||||
long int l = (errno = 0, strtol (operand, &endp, 10));
|
||||
int i = l;
|
||||
signum = (operand == endp || *endp || errno || i != l ? -1
|
||||
: WIFSIGNALED (i) ? WTERMSIG (i) : i);
|
||||
signum = (operand == endp || *endp || errno || i != l ? -1 : i);
|
||||
|
||||
if (signum != -1)
|
||||
{
|
||||
/* Note AIX uses a different bit pattern for status returned
|
||||
from shell and wait(), so we can't use WTERMSIG etc. here.
|
||||
Also ksh returns 0xFF + signal number. */
|
||||
signum &= signum >= 0xFF ? 0xFF : 0x7F;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user