[Wine-patches] [eterhack] server: Do not close file descriptors immediately only for regular files.

Alexander Morozov amorozov на etersoft.ru
Ср Авг 5 14:06:53 MSD 2009


----------- следующая часть -----------
From 63f8e1b534c752a3f9eb576f04345b62a5e43889 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 5 Aug 2009 13:53:11 +0400
Subject: [eterhack] server: Do not close file descriptors immediately only for regular files.

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

diff --git a/server/fd.c b/server/fd.c
index 8259ea5..9e31366 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1079,7 +1079,10 @@ static struct inode *get_inode( dev_t dev, ino_t ino, int unix_fd )
 /* add fd to the inode list of file descriptors to close */
 static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd )
 {
-    if (!list_empty( &inode->open ))
+    struct stat st;
+
+    if (fd->unix_fd != -1) fstat( fd->unix_fd, &st );
+    if ((fd->unix_fd == -1 || S_ISREG( st.st_mode )) && !list_empty( &inode->open ))
     {
         list_add_head( &inode->closed, &fd->entry );
     }
-- 
1.6.3.3



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