]> git.ipfire.org Git - thirdparty/util-linux.git/commit
setarch: fix personality syscall return code check
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 4 Mar 2016 21:22:52 +0000 (00:22 +0300)
committerKarel Zak <kzak@redhat.com>
Mon, 7 Mar 2016 13:23:21 +0000 (14:23 +0100)
commitae7065760d9bbe776a93a73d88e85c7796acb8cc
tree4fb2c61f61aa096750be9cd0e2784ac8ab254b68
parent7154cc892688f3c58cbbcdc2055f2635c1d0ef5b
setarch: fix personality syscall return code check

Depending on architecture and kernel version, personality
syscall is either capable or incapable of returning an error.
If the return value is not an error, then it's the previous
personality value, which can be an arbitrary value
undistinguishable from an error value.
To make things clear, a second call is needed.

For more details about personality syscall peculiarities see
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=glibc-2.22-637-ge0043e17dfc5

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
sys-utils/setarch.c