[Wine-patches] [eterhack] server: Do not open second file descriptor for locks if file is a directory.

Alexander Morozov amorozov на etersoft.ru
Вт Авг 4 18:49:40 MSD 2009


----------- следующая часть -----------
From 18d03d4ff3d4e5e3786478f28de2becd60f5a3f2 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 4 Aug 2009 18:46:49 +0400
Subject: [eterhack] server: Do not open second file descriptor for locks if file is a directory.

---
 server/fd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/server/fd.c b/server/fd.c
index 9071611..e7aec09 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1767,7 +1767,8 @@ struct fd *open_fd( const char *name, int flags, mode_t *mode, unsigned int acce
         fd->closed = closed_fd;
         list_add_head( &inode->open, &fd->inode_entry );
 
-        if (rw_mode != O_RDWR && inode_get_lock_fd( inode ) == -1 &&
+        if (!S_ISDIR(st.st_mode) && rw_mode != O_RDWR &&
+            inode_get_lock_fd( inode ) == -1 &&
             (!etersoft_check_cifs || !etersoft_check_cifs()))
         {
             lock_fd = open( name, O_RDWR );
-- 
1.6.3.3



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