summaryrefslogtreecommitdiff
path: root/src/libstddjb/fd_lock.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-05-14 23:17:52 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-05-14 23:17:52 +0000
commit0c99a8d8aa8ebfabe4d72d092a8c0d8298a233ba (patch)
tree0badc2c39a194539955defbf576e8daf5fed843c /src/libstddjb/fd_lock.c
parentd7fdd3f5cb297cddf08b8962040e48095893ab02 (diff)
downloadskalibs-0c99a8d8aa8ebfabe4d72d092a8c0d8298a233ba.tar.xz
Cosmetic fixes
Diffstat (limited to 'src/libstddjb/fd_lock.c')
-rw-r--r--src/libstddjb/fd_lock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstddjb/fd_lock.c b/src/libstddjb/fd_lock.c
index e9d1a62..a4ebaa5 100644
--- a/src/libstddjb/fd_lock.c
+++ b/src/libstddjb/fd_lock.c
@@ -19,8 +19,8 @@ int fd_lock (int fd, int w, int nb)
int e = errno ;
int r ;
do r = fcntl(fd, nb ? F_SETLK : F_SETLKW, &fl) ;
- while (r < 0 && errno == EINTR) ;
- return r >= 0 ? 1 :
+ while (r == -1 && errno == EINTR) ;
+ return r != -1 ? 1 :
errno == EACCES || error_isagain(errno) ? (errno = e, 0) :
-1 ;
}