From: Hallvard Furuseth Date: Wed, 3 Oct 2012 16:06:29 +0000 (+0200) Subject: ITS#7377 Wrap fcntl F_SETLK in EINTR loop too. X-Git-Tag: OPENLDAP_REL_ENG_2_4_34~139^2~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=38fb8e6eb1c2db048fd2473bfcdd5eb16ec54517;p=openldap ITS#7377 Wrap fcntl F_SETLK in EINTR loop too. This can happen even on local filesystems. --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index e92b5e7b1b..9e3e2ae9d7 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -2806,7 +2806,9 @@ mdb_env_excl_lock(MDB_env *env, int *excl) lock_info.l_whence = SEEK_SET; lock_info.l_start = 0; lock_info.l_len = 1; - if (!fcntl(env->me_lfd, F_SETLK, &lock_info)) { + while ((rc = fcntl(env->me_lfd, F_SETLK, &lock_info)) && + (rc = ErrCode()) == EINTR) ; + if (!rc) { *excl = 1; } else # ifdef MDB_USE_POSIX_SEM