summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorPeter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au>2008-04-07 07:56:41 +0930
committerPeter Hutterer <whot@potoroo.wearablelab.ml.unisa.edu.au>2008-04-07 07:56:41 +0930
commitfd06e8f8c1d82a9d91931e8532bee0fd9c9ca9ab (patch)
treefda1a9d90f4a3e99af9da656939ff8c112cfeb33 /os
parentb46a00918691cbd5ca80b6d3acae7614f93e073b (diff)
parent6c0cfe3d43b177c4cfaf7e228f32c655f9a98459 (diff)
Merge branch 'master' into dcdc_rework
Conflicts: Xext/xevie.c dix/dispatch.c
Diffstat (limited to 'os')
-rw-r--r--os/access.c18
-rw-r--r--os/connection.c1
-rw-r--r--os/io.c139
-rw-r--r--os/osdep.h2
-rw-r--r--os/utils.c7
5 files changed, 24 insertions, 143 deletions
diff --git a/os/access.c b/os/access.c
index e91dd37e4..db14380df 100644
--- a/os/access.c
+++ b/os/access.c
@@ -713,19 +713,21 @@ void
DefineSelf (int fd)
{
#ifndef HAS_GETIFADDRS
- char buf[2048], *cp, *cplim;
- void * bufptr = buf;
-#ifdef USE_SIOCGLIFCONF
+ char *cp, *cplim;
+# ifdef USE_SIOCGLIFCONF
+ struct sockaddr_storage buf[16];
struct lifconf ifc;
register struct lifreq *ifr;
-#ifdef SIOCGLIFNUM
+# ifdef SIOCGLIFNUM
struct lifnum ifn;
-#endif
-#else
+# endif
+# else /* !USE_SIOCGLIFCONF */
+ char buf[2048];
struct ifconf ifc;
register struct ifreq *ifr;
-#endif
-#else
+# endif
+ void * bufptr = buf;
+#else /* HAS_GETIFADDRS */
struct ifaddrs * ifap, *ifr;
#endif
int len;
diff --git a/os/connection.c b/os/connection.c
index 8b6541ce6..1ae50fef0 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -546,7 +546,6 @@ AuthAudit (ClientPtr client, Bool letin,
{
char addr[128];
char *out = addr;
- int client_uid;
char client_uid_string[64];
LocalClientCredRec *lcc;
#ifdef XSERVER_DTRACE
diff --git a/os/io.c b/os/io.c
index be89021e5..4f4a10903 100644
--- a/os/io.c
+++ b/os/io.c
@@ -91,8 +91,6 @@ _X_EXPORT CallbackListPtr FlushCallback;
static ConnectionInputPtr AllocateInputBuffer(void);
static ConnectionOutputPtr AllocateOutputBuffer(void);
-static xReqPtr PeekNextRequest(xReqPtr req, ClientPtr client, Bool readmore);
-static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped);
/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
@@ -618,135 +616,8 @@ ResetCurrentRequest(ClientPtr client)
-/*****************************************************************
- * PeekNextRequest and SkipRequests were implemented to support DBE
- * idioms, but can certainly be used outside of DBE. There are two
- * related macros in os.h, ReqLen and CastxReq. See the porting
- * layer document for more details.
- *
- **********************/
-
-
-/*****************************************************************
- * PeekNextRequest
- * lets you look ahead at the unexecuted requests in a
- * client's request buffer.
- *
- * Note: this implementation of PeekNextRequest ignores the
- * readmore parameter.
- *
- **********************/
-
-static xReqPtr
-PeekNextRequest(
- xReqPtr req, /* request we're starting from */
- ClientPtr client, /* client whose requests we're skipping */
- Bool readmore) /* attempt to read more if next request isn't there? */
-{
- register ConnectionInputPtr oci = ((OsCommPtr)client->osPrivate)->input;
- xReqPtr pnextreq;
- int needed, gotnow, reqlen;
-
- if (!oci) return NULL;
-
- if (!req)
- {
- /* caller wants the request after the one currently being executed */
- pnextreq = (xReqPtr)
- (((CARD32 *)client->requestBuffer) + client->req_len);
- }
- else
- {
- /* caller wants the request after the one specified by req */
- reqlen = get_req_len(req, client);
-#ifdef BIGREQS
- if (!reqlen) reqlen = get_big_req_len(req, client);
-#endif
- pnextreq = (xReqPtr)(((char *)req) + (reqlen << 2));
- }
-
- /* see how much of the next request we have available */
-
- gotnow = oci->bufcnt - (((char *)pnextreq) - oci->buffer);
-
- if (gotnow < sizeof(xReq))
- return NULL;
-
- needed = get_req_len(pnextreq, client) << 2;
-#ifdef BIGREQS
- if (!needed)
- {
- /* it's a big request */
- if (gotnow < sizeof(xBigReq))
- return NULL;
- needed = get_big_req_len(pnextreq, client) << 2;
- }
-#endif
-
- /* if we have less than we need, return NULL */
-
- return (gotnow < needed) ? NULL : pnextreq;
-}
-
-/*****************************************************************
- * SkipRequests
- * lets you skip over some of the requests in a client's
- * request buffer. Presumably the caller has used PeekNextRequest
- * to examine the requests being skipped and has performed whatever
- * actions they dictate.
- *
- **********************/
-
_X_EXPORT CallbackListPtr SkippedRequestsCallback = NULL;
-static void
-SkipRequests(
- xReqPtr req, /* last request being skipped */
- ClientPtr client, /* client whose requests we're skipping */
- int numskipped) /* how many requests we're skipping */
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- register ConnectionInputPtr oci = oc->input;
- int reqlen;
-
- /* see if anyone wants to snoop the skipped requests */
-
- if (SkippedRequestsCallback)
- {
- SkippedRequestInfoRec skipinfo;
- skipinfo.req = req;
- skipinfo.client = client;
- skipinfo.numskipped = numskipped;
- CallCallbacks(&SkippedRequestsCallback, &skipinfo);
- }
-
- /* adjust the sequence number */
- client->sequence += numskipped;
-
- /* twiddle the oci to skip over the requests */
-
- reqlen = get_req_len(req, client);
-#ifdef BIGREQS
- if (!reqlen) reqlen = get_big_req_len(req, client);
-#endif
- reqlen <<= 2;
- oci->bufptr = (char *)req;
- oci->lenLastReq = reqlen;
-
- /* see if any requests left in the buffer */
-
- if ( ((char *)req + reqlen) == (oci->buffer + oci->bufcnt) )
- {
- /* no requests; mark input buffer as available and client
- * as having no input
- */
- int fd = oc->fd;
- AvailableInput = oc;
- YieldControlNoInput();
- }
-}
-
-
/* lookup table for adding padding bytes to data that is read from
or written to the X socket. */
static int padlength[4] = {0, 3, 2, 1};
@@ -859,11 +730,12 @@ SetCriticalOutputPending(void)
*****************/
_X_EXPORT int
-WriteToClient (ClientPtr who, int count, char *buf)
+WriteToClient (ClientPtr who, int count, const void *__buf)
{
OsCommPtr oc = (OsCommPtr)who->osPrivate;
ConnectionOutputPtr oco = oc->output;
int padBytes;
+ const char *buf = __buf;
#ifdef DEBUG_COMMUNICATION
Bool multicount = FALSE;
#endif
@@ -1000,13 +872,14 @@ WriteToClient (ClientPtr who, int count, char *buf)
**********************/
int
-FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
+FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
{
ConnectionOutputPtr oco = oc->output;
int connection = oc->fd;
XtransConnInfo trans_conn = oc->trans_conn;
struct iovec iov[3];
static char padBuffer[3];
+ const char *extraBuf = __extraBuf;
long written;
long padsize;
long notWritten;
@@ -1045,14 +918,14 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
before = (-len); \
} else { \
iov[i].iov_len = len; \
- iov[i].iov_base = (pointer) + before; \
+ iov[i].iov_base = (pointer) + before; \
i++; \
remain -= len; \
before = 0; \
}
InsertIOV ((char *)oco->buf, oco->count)
- InsertIOV (extraBuf, extraCount)
+ InsertIOV ((char *)extraBuf, extraCount)
InsertIOV (padBuffer, padsize)
errno = 0;
diff --git a/os/osdep.h b/os/osdep.h
index b6894c146..84f7177db 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -184,7 +184,7 @@ typedef struct _osComm {
extern int FlushClient(
ClientPtr /*who*/,
OsCommPtr /*oc*/,
- char* /*extraBuf*/,
+ const void * /*extraBuf*/,
int /*extraCount*/
);
diff --git a/os/utils.c b/os/utils.c
index 3f4355f46..d2b567484 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -232,9 +232,16 @@ _X_EXPORT Bool noXInputExtension = FALSE;
#ifdef XIDLE
_X_EXPORT Bool noXIdleExtension = FALSE;
#endif
+#ifdef XSELINUX
+_X_EXPORT Bool noSELinuxExtension = FALSE;
+_X_EXPORT int selinuxEnforcingState = SELINUX_MODE_DEFAULT;
+#endif
#ifdef XV
_X_EXPORT Bool noXvExtension = FALSE;
#endif
+#ifdef DRI2
+_X_EXPORT Bool noDRI2Extension = FALSE;
+#endif
_X_EXPORT Bool noGEExtension = FALSE;