[Wine-patches] [eter-1.0.12] server: Add partial support of overlapping shared and exclusive locks (eterbug #7710).

Alexander Morozov amorozov на etersoft.ru
Пт Окт 14 20:04:04 MSD 2011


----------- следующая часть -----------
From 949ee30f3d56f69f9b3ca26b1e3253c0fe495d02 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 14 Oct 2011 20:01:05 +0400
Subject: [eter-1.0.12] server: Add partial support of overlapping shared and
 exclusive locks (eterbug #7710).

---
 server/fd.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/server/fd.c b/server/fd.c
index 1a09678..4523588 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1320,9 +1320,9 @@ static struct file_lock *add_lock( struct fd *fd, int shared, file_pos_t start,
         release_object( lock );
         return NULL;
     }
-    list_add_head( &fd->locks, &lock->fd_entry );
-    list_add_head( &fd->inode->locks, &lock->inode_entry );
-    list_add_head( &lock->process->locks, &lock->proc_entry );
+    list_add_tail( &fd->locks, &lock->fd_entry );
+    list_add_tail( &fd->inode->locks, &lock->inode_entry );
+    list_add_tail( &lock->process->locks, &lock->proc_entry );
     return lock;
 }
 
@@ -1393,7 +1393,16 @@ obj_handle_t lock_fd( struct fd *fd, file_pos_t start, file_pos_t count, int sha
     {
         struct file_lock *lock = LIST_ENTRY( ptr, struct file_lock, inode_entry );
         if (!lock_overlaps( lock, start, end )) continue;
-        if (lock->shared && shared) continue;
+        if (shared)
+        {
+            if (lock->shared) continue;
+            if (lock->fd == fd)
+            {
+                fprintf( stderr, "wineserver: overlapping exclusive "
+                         "and non-exclusive locks is not fully supported\n" );
+                continue;
+            }
+        }
         /* found one */
         if (!wait)
         {
-- 
1.7.6.1



Подробная информация о списке рассылки Wine-patches