]> git.sur5r.net Git - openldap/commitdiff
ITS#7377 Wrap fcntl F_SETLK in EINTR loop too.
authorHallvard Furuseth <hallvard@openldap.org>
Wed, 3 Oct 2012 16:06:29 +0000 (18:06 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Wed, 3 Oct 2012 16:06:29 +0000 (18:06 +0200)
This can happen even on local filesystems.

libraries/libmdb/mdb.c

index e92b5e7b1bd11f1947cb2dfaf03e6fcd424833d7..9e3e2ae9d75dd1abf9baa2d47a4ae226872b1114 100644 (file)
@@ -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