summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2010-02-18 23:36:27 -0600
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-01-02 19:40:08 +0000
commit8f63f73095db6a58c5f322c178b3ef25a7ef67a3 (patch)
tree4b5fb9f79a7387b3e1816287eb9806d9d3796942 /os
parenta09ccbcd9a24052006028dfc0b7d4252240c05e9 (diff)
Improve choice of display name used by internal clients
Choose display name used to connect internal clients and exported into environment of processes started by traymenu so that it uses a transport we know is working This should mean the server can start correctly with -multiwindow and/or -clipboard and any two of -nolisten inet6, -nolisten inet and -nolisten unix (the server will correctly refuse to start if all 3 are used, as it must be listening on at least one socket) v2: Place prototype for winGetDisplayName() in windisplay.h, and include it where needed. XXX: TransIsListening would be better written in xtrans, rather than grovelling around in the servers list of listeners, see [1] for patch. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=10725 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Diffstat (limited to 'os')
-rw-r--r--os/connection.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/os/connection.c b/os/connection.c
index 162e1d93e..5a573916a 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -269,6 +269,21 @@ lookup_trans_conn(int fd)
return NULL;
}
+int
+TransIsListening(char *protocol)
+{
+ /* look for this transport in the list of listeners */
+ int i;
+
+ for (i = 0; i < ListenTransCount; i++) {
+ if (!strcmp(protocol, ListenTransConns[i]->transptr->TransName)) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */
void