Commit 1bebacbd authored by Andrew G. Morgan's avatar Andrew G. Morgan
Browse files

setcap: fix errno display

The commit 056ffb0b broke the display of
the final error message because it would do more operations that would
clobber errno.  Example:
(libcap-2.22) sudo setcap cap_ipc_lock=ep /proc/filesystems | head -1
Failed to set capabilities on file `/proc/filesystems' (Operation not supported)
(libcap-2.23) sudo setcap cap_ipc_lock=ep /proc/filesystems | head -1
Failed to set capabilities on file `/proc/filesystems' (Invalid argument)

Save the original errno value and use that for the final display instead.

URL: https://bugs.gentoo.org/551672


Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarAndrew G. Morgan <morgan@kernel.org>
parent ebcbf9f9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment