diff options
author | Yang Xu <xuyang2018.jy@fujitsu.com> | 2022-08-04 14:18:52 +0800 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2022-08-20 22:23:29 +0800 |
commit | bf1ef26900eec3b028c1b0f55f65b3b233e47c56 (patch) | |
tree | 34afaf33aa0f52a2d384ebd55b4f9e5102d1c0e8 | |
parent | 192f5297b54f601eae7047eb4e1e69ec5fd03b1e (diff) |
src/t_ofd_locks.c: Reset errno to zerov2022.08.21
It seems I met libcap errno bug again when using libcap-2.48-4.el8.x86_64.
But this time, errno is EINVAL if c program link with lcap.
Lastest upstream libcap doesn't have bug and it should be backport bug.
generic/478 will become not run because of this. To fix this that only
exists on some distributions, reset errno to zero.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r-- | src/t_ofd_locks.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/t_ofd_locks.c b/src/t_ofd_locks.c index e3b15ddc..e77f2659 100644 --- a/src/t_ofd_locks.c +++ b/src/t_ofd_locks.c @@ -187,6 +187,8 @@ int main(int argc, char **argv) struct sembuf sop; int opt, ret, retry; + //avoid libcap errno bug + errno = 0; while((opt = getopt(argc, argv, "sgrwo:l:PRWtFd")) != -1) { switch(opt) { case 's': |