[Spice-devel] [PATCH v2 2/3] vdagent: Allow disabling the server-side udscs support

Francois Gouget fgouget at codeweavers.com
Fri Nov 13 07:26:19 PST 2015


To do so define UDSCS_NO_SERVER.
This simplifies reuse in client-only scenarios that don't need peer
credential support for instance.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 src/udscs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/udscs.c b/src/udscs.c
index 732db33..334d54a 100644
--- a/src/udscs.c
+++ b/src/udscs.c
@@ -46,8 +46,10 @@ struct udscs_connection {
     const char * const *type_to_string;
     int no_types;
     int debug;
-    struct ucred peer_cred;
     void *user_data;
+#ifndef UDSCS_NO_SERVER
+    struct ucred peer_cred;
+#endif
 
     /* Read stuff, single buffer, separate header and data buffer */
     int header_read;
@@ -350,6 +352,8 @@ int udscs_client_fill_fds(struct udscs_connection *conn, fd_set *readfds,
 }
 
 
+#ifndef UDSCS_NO_SERVER
+
 /* ---------- Server-side implementation ---------- */
 
 struct udscs_server {
@@ -563,3 +567,5 @@ int udscs_server_for_all_clients(struct udscs_server *server,
     }
     return r;
 }
+
+#endif
-- 
2.6.2



More information about the Spice-devel mailing list