[Spice-devel] [PATCH vdagent 2/2] vdagentd: Fix building warning

Dunrong Huang riegamaths at gmail.com
Wed Dec 5 00:01:59 PST 2012


Move some variable declarations to right place.

Signed-off-by: Dunrong Huang <riegamaths at gmail.com>
---
 src/vdagentd.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/vdagentd.c b/src/vdagentd.c
index 7006d80..a51ac4c 100644
--- a/src/vdagentd.c
+++ b/src/vdagentd.c
@@ -510,10 +510,9 @@ void release_clipboards(void)
 
 void update_active_session_connection(void)
 {
-    struct udscs_connection *new_conn = NULL;
-    int n;
-
 #ifdef HAVE_SESSION_INFO
+    int n;
+    struct udscs_connection *new_conn = NULL;
     if (!active_session)
         active_session = session_info_get_active_session(session_info);
 
@@ -541,7 +540,9 @@ void update_active_session_connection(void)
 
 void agent_connect(struct udscs_connection *conn)
 {
+#ifdef HAVE_SESSION_INFO
     uint32_t pid;
+#endif
     struct agent_data *agent_data;
 
     agent_data = calloc(1, sizeof(*agent_data));
@@ -707,7 +708,10 @@ void daemonize(void)
 void main_loop(void)
 {
     fd_set readfds, writefds;
-    int n, nfds, ck_fd = 0;
+    int n, nfds;
+#ifdef HAVE_SESSION_INFO
+    int ck_fd = 0;
+#endif
 
     while (!quit) {
         FD_ZERO(&readfds);
-- 
1.8.0



More information about the Spice-devel mailing list