server: Deal with stale WINESERVERSOCKET environment variables.

Francois Gouget fgouget at codeweavers.com
Wed Nov 22 12:27:31 CST 2006


---
 dlls/ntdll/server.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 5dd9c53..64f632d 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -933,9 +933,15 @@ void server_init_process(void)
     {
         fd_socket = atoi( env_socket );
         if (fcntl( fd_socket, F_SETFD, 1 ) == -1)
-            fatal_perror( "Bad server socket %d", fd_socket );
+        {
+            /* WINESERVERSOCKET is probably a stale environment variable we
+             * got through a Wine -> Unix -> Wine fork() sequence.
+             * Just ignore it.
+             */
+            fd_socket = -1;
+        }
     }
-    else
+    if (fd_socket == -1)
     {
         const char *server_dir = wine_get_server_dir();
 
-- 
1.4.3.3



More information about the wine-patches mailing list