diff options
author | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-09 05:23:48 +0000 |
commit | 81f91c615982e50bb62708201569c33a3cd3d973 (patch) | |
tree | 4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/os/connection.c | |
parent | b571a562410f565af2bdde52d9f7f9a23ffae04f (diff) | |
parent | a915739887477b28d924ecc8417ee107d125bd6c (diff) | |
download | vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2 vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/os/connection.c')
-rw-r--r-- | xorg-server/os/connection.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index 9148b4ea8..eabfdaee0 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -150,7 +150,7 @@ Bool NewOutputPending; /* not yet attempted to write some new output */ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ -Bool PartialNetwork; /* continue even if unable to bind all addrs */ +Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; static Bool debug_conns = FALSE; @@ -160,7 +160,7 @@ static fd_set GrabImperviousClients; static fd_set SavedAllClients; static fd_set SavedAllSockets; static fd_set SavedClientsWithInput; -_X_EXPORT int GrabInProgress = 0; +int GrabInProgress = 0; #if !defined(WIN32) int *ConnectionTranslation = NULL; @@ -176,7 +176,6 @@ int *ConnectionTranslation = NULL; #define MAXSOCKS 500 #undef MAXSELECT #define MAXSELECT 500 -#define MAXFD 500 struct _ct_node { struct _ct_node *next; @@ -231,7 +230,7 @@ void SetConnectionTranslation(int conn, int client) } node = &((*node)->next); } - *node = (struct _ct_node*)xalloc(sizeof(struct _ct_node)); + *node = xalloc(sizeof(struct _ct_node)); (*node)->next = NULL; (*node)->key = conn; (*node)->value = client; @@ -350,15 +349,6 @@ InitParentProcess(void) RunFromSmartParent = TRUE; OsSignal(SIGUSR1, handler); ParentProcess = getppid (); -#ifdef __UNIXOS2__ - /* - * fg030505: under OS/2, xinit is not the parent process but - * the "grant parent" process of the server because execvpe() - * presents us an additional process number; - * GetPPID(pid) is part of libemxfix - */ - ParentProcess = GetPPID (ParentProcess); -#endif /* __UNIXOS2__ */ #endif } @@ -411,7 +401,7 @@ CreateWellKnownSockets(void) } else { - ListenTransFds = (int *) xalloc (ListenTransCount * sizeof (int)); + ListenTransFds = xalloc (ListenTransCount * sizeof (int)); for (i = 0; i < ListenTransCount; i++) { @@ -649,7 +639,7 @@ AuthorizationIDOfClient(ClientPtr client) * *****************************************************************/ -char * +char * ClientAuthorized(ClientPtr client, unsigned int proto_n, char *auth_proto, unsigned int string_n, char *auth_string) @@ -693,7 +683,7 @@ ClientAuthorized(ClientPtr client, proto_n, auth_proto, auth_id); } - xfree ((char *) from); + xfree (from); } if (auth_id == (XID) ~0L) { @@ -715,7 +705,7 @@ ClientAuthorized(ClientPtr client, AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); - xfree ((char *) from); + xfree (from); } } priv->auth_id = auth_id; @@ -751,7 +741,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) #endif ) return NullClient; - oc = (OsCommPtr)xalloc(sizeof(OsCommRec)); + oc = xalloc(sizeof(OsCommRec)); if (!oc) return NullClient; oc->trans_conn = trans_conn; @@ -841,7 +831,7 @@ EstablishNewConnections(ClientPtr clientUnused, pointer closure) int status; #ifndef WIN32 - curconn = ffs (readyconnections.fds_bits[i]) - 1; + curconn = mffs (readyconnections.fds_bits[i]) - 1; readyconnections.fds_bits[i] &= ~((fd_mask)1 << curconn); curconn += (i * (sizeof(fd_mask)*8)); #else @@ -1006,7 +996,7 @@ CheckConnections(void) mask = AllClients.fds_bits[i]; while (mask) { - curoff = ffs (mask) - 1; + curoff = mffs (mask) - 1; curclient = curoff + (i * (sizeof(fd_mask)*8)); FD_ZERO(&tmask); FD_SET(curclient, &tmask); @@ -1060,7 +1050,7 @@ CloseDownConnection(ClientPtr client) AuditF("client %d disconnected\n", client->index); } -_X_EXPORT void +void AddGeneralSocket(int fd) { FD_SET(fd, &AllSockets); @@ -1068,14 +1058,14 @@ AddGeneralSocket(int fd) FD_SET(fd, &SavedAllSockets); } -_X_EXPORT void +void AddEnabledDevice(int fd) { FD_SET(fd, &EnabledDevices); AddGeneralSocket(fd); } -_X_EXPORT void +void RemoveGeneralSocket(int fd) { FD_CLR(fd, &AllSockets); @@ -1083,7 +1073,7 @@ RemoveGeneralSocket(int fd) FD_CLR(fd, &SavedAllSockets); } -_X_EXPORT void +void RemoveEnabledDevice(int fd) { FD_CLR(fd, &EnabledDevices); @@ -1155,7 +1145,7 @@ ListenToAllClients(void) * Must have cooresponding call to AttendClient. ****************/ -_X_EXPORT void +void IgnoreClient (ClientPtr client) { OsCommPtr oc = (OsCommPtr)client->osPrivate; @@ -1190,7 +1180,7 @@ IgnoreClient (ClientPtr client) * Adds one client back into the input masks. ****************/ -_X_EXPORT void +void AttendClient (ClientPtr client) { OsCommPtr oc = (OsCommPtr)client->osPrivate; @@ -1264,7 +1254,7 @@ MakeClientGrabPervious(ClientPtr client) #ifdef XQUARTZ /* Add a fd (from launchd) to our listeners */ -_X_EXPORT void ListenOnOpenFD(int fd, int noxauth) { +void ListenOnOpenFD(int fd, int noxauth) { char port[256]; XtransConnInfo ciptr; |