]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
src/t_ofd_locks.c: Reset errno to zero v2022.08.21
authorYang Xu <xuyang2018.jy@fujitsu.com>
Thu, 4 Aug 2022 06:18:52 +0000 (14:18 +0800)
committerZorro Lang <zlang@kernel.org>
Sat, 20 Aug 2022 14:23:29 +0000 (22:23 +0800)
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>
src/t_ofd_locks.c

index e3b15ddc6ee871aeaf972a59c0d0b69b9f54c2f0..e77f2659b6bd8b58e2cf96ff423cab06725a227a 100644 (file)
@@ -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':