The flag is to be used to mark transports related to sockets
received from systemd.

Signed-off-by: Łukasz Stelmach <l.stelm...@samsung.com>
Cc: Kyungmin Park <kyungmin.p...@samsung.com>
Cc: MyungJoo Ham <myungjoo....@samsung.com>
Cc: Piort Bereza <p.ber...@samsung.com>
Cc: Karol Lewandowski <k.lewando...@samsung.com>
Cc: Lennart Poettering <lenn...@poettering.net>
Cc: Zbigniew Jędrzejewski-Szmek <zbys...@in.waw.pl>
Cc: Peter Hutterer <peter.hutte...@who-t.net>
Cc: walter harms <wha...@bfs.de>
Cc: Alan Coopersmith <alan.coopersm...@oracle.com>
---
 Xtrans.c    |   28 ++++++++++++++++++++++++++++
 Xtrans.h    |    4 ++++
 Xtransint.h |    1 +
 3 files changed, 33 insertions(+)

diff --git a/Xtrans.c b/Xtrans.c
index 0799f04..5860f3a 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -744,6 +744,34 @@ TRANS(CreateListener) (XtransConnInfo ciptr, char *port, 
unsigned int flags)
 }
 
 int
+TRANS(Received) (const char * protocol)
+
+{
+   Xtransport *trans;
+   int i = 0, ret = 0;
+
+   prmsg (5, "Received(%s)\n", protocol);
+
+   if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
+   {
+       prmsg (1,"Received: unable to find transport: %s\n",
+              protocol);
+
+       return -1;
+   }
+   if (trans->flags & TRANS_ALIAS) {
+       if (trans->nolisten)
+          while (trans->nolisten[i]) {
+              ret |= TRANS(Received)(trans->nolisten[i]);
+              i++;
+       }
+   }
+
+   trans->flags |= TRANS_RECEIVED;
+   return ret;
+}
+
+int
 TRANS(NoListen) (const char * protocol)
 
 {
diff --git a/Xtrans.h b/Xtrans.h
index 2945b2a..4ffca9a 100644
--- a/Xtrans.h
+++ b/Xtrans.h
@@ -303,6 +303,10 @@ int TRANS(CreateListener)(
     unsigned int       /* flags */
 );
 
+int TRANS(Received) (
+    const char*         /* protocol*/
+);
+
 int TRANS(NoListen) (
     const char*         /* protocol*/
 );
diff --git a/Xtransint.h b/Xtransint.h
index 3bce8dc..dd83b6f 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -307,6 +307,7 @@ typedef struct _Xtransport_table {
 #define TRANS_NOUNLINK (1<<4)  /* Don't unlink transport endpoints */
 #define TRANS_ABSTRACT (1<<5)  /* Use abstract sockets if available */
 #define TRANS_NOXAUTH  (1<<6)  /* Don't verify authentication (because it's 
secure some other way at the OS layer) */
+#define TRANS_RECEIVED (1<<7)  /* The fd for this has already been opened by 
someone else. */
 
 /* Flags to preserve when setting others */
 #define TRANS_KEEPFLAGS        (TRANS_NOUNLINK|TRANS_ABSTRACT)
-- 
1.7.9.5

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to