Merge branch 'for-whot' of git://people.freedesktop.org/~alanc/xserver into for-keith
This commit is contained in:
commit
7528a6b88e
|
@ -190,7 +190,7 @@ core_get_type(const xEvent *event)
|
||||||
static inline int
|
static inline int
|
||||||
xi2_get_type(const xEvent *event)
|
xi2_get_type(const xEvent *event)
|
||||||
{
|
{
|
||||||
xGenericEvent* e = (xGenericEvent*)event;
|
const xGenericEvent* e = (const xGenericEvent*)event;
|
||||||
|
|
||||||
return (e->type != GenericEvent || e->extension != IReqCode) ? 0 : e->evtype;
|
return (e->type != GenericEvent || e->extension != IReqCode) ? 0 : e->evtype;
|
||||||
}
|
}
|
||||||
|
|
35
dix/grabs.c
35
dix/grabs.c
|
@ -62,6 +62,7 @@ SOFTWARE.
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
|
#include "client.h"
|
||||||
|
|
||||||
#define BITMASK(i) (((Mask)1) << ((i) & 31))
|
#define BITMASK(i) (((Mask)1) << ((i) & 31))
|
||||||
#define MASKIDX(i) ((i) >> 5)
|
#define MASKIDX(i) ((i) >> 5)
|
||||||
|
@ -78,25 +79,41 @@ PrintDeviceGrabInfo(DeviceIntPtr dev)
|
||||||
int i, j;
|
int i, j;
|
||||||
GrabInfoPtr devGrab = &dev->deviceGrab;
|
GrabInfoPtr devGrab = &dev->deviceGrab;
|
||||||
GrabPtr grab = devGrab->grab;
|
GrabPtr grab = devGrab->grab;
|
||||||
|
Bool clientIdPrinted = FALSE;
|
||||||
|
|
||||||
ErrorF("Active grab 0x%lx (%s) on device '%s' (%d):",
|
ErrorF("Active grab 0x%lx (%s) on device '%s' (%d):\n",
|
||||||
(unsigned long) grab->resource,
|
(unsigned long) grab->resource,
|
||||||
(grab->grabtype == XI2) ? "xi2" :
|
(grab->grabtype == XI2) ? "xi2" :
|
||||||
((grab->grabtype == CORE) ? "core" : "xi1"),
|
((grab->grabtype == CORE) ? "core" : "xi1"),
|
||||||
dev->name, dev->id);
|
dev->name, dev->id);
|
||||||
|
|
||||||
client = clients[CLIENT_ID(grab->resource)];
|
client = clients[CLIENT_ID(grab->resource)];
|
||||||
if (client && GetLocalClientCreds(client, &lcc) != -1)
|
if (client)
|
||||||
{
|
{
|
||||||
ErrorF(" client pid %ld uid %ld gid %ld\n",
|
pid_t clientpid = GetClientPid(client);
|
||||||
(lcc->fieldsSet & LCC_PID_SET) ? (long) lcc->pid : 0,
|
const char *cmdname = GetClientCmdName(client);
|
||||||
(lcc->fieldsSet & LCC_UID_SET) ? (long) lcc->euid : 0,
|
const char *cmdargs = GetClientCmdArgs(client);
|
||||||
(lcc->fieldsSet & LCC_GID_SET) ? (long) lcc->egid : 0);
|
|
||||||
FreeLocalClientCreds(lcc);
|
if ((clientpid > 0) && (cmdname != NULL))
|
||||||
|
{
|
||||||
|
ErrorF(" client pid %ld %s %s\n",
|
||||||
|
(long) clientpid, cmdname, cmdargs ? cmdargs : "");
|
||||||
|
clientIdPrinted = TRUE;
|
||||||
|
}
|
||||||
|
else if (GetLocalClientCreds(client, &lcc) != -1)
|
||||||
|
{
|
||||||
|
ErrorF(" client pid %ld uid %ld gid %ld\n",
|
||||||
|
(lcc->fieldsSet & LCC_PID_SET) ? (long) lcc->pid : 0,
|
||||||
|
(lcc->fieldsSet & LCC_UID_SET) ? (long) lcc->euid : 0,
|
||||||
|
(lcc->fieldsSet & LCC_GID_SET) ? (long) lcc->egid : 0);
|
||||||
|
FreeLocalClientCreds(lcc);
|
||||||
|
clientIdPrinted = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
if (!clientIdPrinted)
|
||||||
{
|
{
|
||||||
ErrorF(" (no client information available)\n");
|
ErrorF(" (no client information available for client %d)\n",
|
||||||
|
CLIENT_ID(grab->resource));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX is this even correct? */
|
/* XXX is this even correct? */
|
||||||
|
|
|
@ -626,7 +626,7 @@ void verify_internal_event(const InternalEvent *ev)
|
||||||
if (ev && ev->any.header != ET_Internal)
|
if (ev && ev->any.header != ET_Internal)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned char *data = (unsigned char*)ev;
|
const unsigned char *data = (const unsigned char*)ev;
|
||||||
|
|
||||||
ErrorF("dix: invalid event type %d\n", ev->any.header);
|
ErrorF("dix: invalid event type %d\n", ev->any.header);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ SOFTWARE.
|
||||||
#include "geext.h"
|
#include "geext.h"
|
||||||
#include "privates.h"
|
#include "privates.h"
|
||||||
|
|
||||||
#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
|
#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
|
||||||
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
|
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
|
||||||
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
|
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
|
||||||
extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
|
extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
|
||||||
|
|
Loading…
Reference in New Issue