[PATCH 11/18] Move exit_on_disconnect to RedsState struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jonathon Jongsma <jjongsma@xxxxxxxxxx>

Removing more global variables
---
 server/reds-private.h | 1 +
 server/reds.c         | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/reds-private.h b/server/reds-private.h
index 9c3db70..5042773 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -224,6 +224,7 @@ struct RedsState {
     gboolean agent_mouse;
     gboolean agent_copypaste;
     gboolean agent_file_xfer;
+    gboolean exit_on_disconnect;
 };
 
 #endif
diff --git a/server/reds.c b/server/reds.c
index f3268d6..b25a1be 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -146,7 +146,6 @@ static SpiceCoreInterfaceInternal core_interface_adapter = {
 
 static pthread_mutex_t *lock_cs;
 static long *lock_count;
-static bool exit_on_disconnect = FALSE;
 
 RedsState *reds = NULL;
 
@@ -458,7 +457,7 @@ void reds_client_disconnect(RedsState *reds, RedClient *client)
 {
     RedsMigTargetClient *mig_client;
 
-    if (exit_on_disconnect)
+    if (reds->exit_on_disconnect)
     {
         spice_info("Exiting server because of client disconnect.\n");
         exit(0);
@@ -3428,6 +3427,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
     reds->agent_mouse = TRUE;
     reds->agent_copypaste = TRUE;
     reds->agent_file_xfer = TRUE;
+    reds->exit_on_disconnect = FALSE;
     return reds;
 }
 
@@ -3540,7 +3540,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_listen_socket_fd(SpiceServer *s, int lis
 SPICE_GNUC_VISIBLE int spice_server_set_exit_on_disconnect(SpiceServer *s, int flag)
 {
     spice_assert(reds == s);
-    exit_on_disconnect = !!flag;
+    s->exit_on_disconnect = !!flag;
     return 0;
 }
 
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]