[Wine-patches] Do not run second wineserver if a license is not terminal (eterbug #1199).

Alexander Morozov amorozov на etersoft.ru
Пн Июл 27 19:17:18 MSD 2009


----------- следующая часть -----------
From 71c4b21f584d26de661372e56348845ca059d97b Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Mon, 27 Jul 2009 19:00:15 +0400
Subject: [PATCH] Do not run second wineserver if a license is not terminal (eterbug #1199).

---
 dlls/ntdll/server.c     |    1 +
 include/wine/etersoft.h |    4 ++++
 server/main.c           |    8 ++++++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 43e967d..1c41a36 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -729,6 +729,7 @@ static void start_server(void)
         }
         waitpid( pid, &status, 0 );
         status = WIFEXITED(status) ? WEXITSTATUS(status) : 1;
+        if (status == 3) fatal_error( "can not start second wineserver\n" );
         if (status == 2) return;  /* server lock held by someone else, will retry later */
         if (status) exit(status);  /* server failed */
         started = 1;
diff --git a/include/wine/etersoft.h b/include/wine/etersoft.h
index 95f8e1a..b7d5152 100644
--- a/include/wine/etersoft.h
+++ b/include/wine/etersoft.h
@@ -112,6 +112,10 @@ static int (*etersoft_valid_license)();
 
 #endif
 
+#ifdef ETERSOFT_FUNC_TERMINAL
+static int (*etersoft_terminal_lock)(void);
+#endif
+
 static int (*etersoft_is_initialize)(void);
 
 static void (*etersoft_fixtab)(void *data, int pointer_size);
diff --git a/server/main.c b/server/main.c
index 8988cec..2d32a99 100644
--- a/server/main.c
+++ b/server/main.c
@@ -37,6 +37,11 @@
 #include "thread.h"
 #include "request.h"
 
+#define WINE_NO_TRACE_MSGS
+#define WINE_NO_DEBUG_MSGS
+#define ETERSOFT_FUNC_TERMINAL
+#include "wine/etersoft.h"
+
 /* command-line options */
 int debug_level = 0;
 int foreground = 0;
@@ -137,6 +142,9 @@ int main( int argc, char *argv[] )
     signal( SIGTERM, sigterm_handler );
     signal( SIGABRT, sigterm_handler );
 
+    LOADETER_FUNC( etersoft_terminal_lock );
+    if (etersoft_terminal_lock && etersoft_terminal_lock()) return 3;
+
     sock_init();
     open_master_socket();
 
-- 
1.6.3.3



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