summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-12-08 06:41:00 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-12-08 06:41:00 +0000
commiteb73d7f749393f6285db64302bc81cb42c4dde18 (patch)
treefb4eccfa9cb93528f7771d016267ad80cbe36e04
parent8982b3c084d8acdae973844cbc4d5b45ff6c6751 (diff)
//bugs.freedesktop.org/show_bug.cgi?id=1402) attachment #948
(https://bugs.freedesktop.org/attachment.cgi?id=948): Fix BigFont extension if SHM is compiled in but not working. Does not access SHM and privates if the SHM syscall failed during extension initialization. Patch by Alexander Gottwald <ago@freedesktop.org>.
-rw-r--r--Xext/xf86bigfont.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index dec2c181e..bcabaefa7 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -99,12 +99,12 @@ static int FontShmdescIndex;
static unsigned int pagesize;
+static Bool badSysCall = FALSE;
+
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
#include <sys/signal.h>
-static Bool badSysCall = FALSE;
-
static void
SigSysHandler(
int signo)
@@ -471,13 +471,16 @@ ProcXF86BigfontQueryFont(
if (nCharInfos > 0) {
#ifdef HAS_SHM
- pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
+ if (!badSysCall)
+ pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
+ else
+ pDesc = NULL;
if (pDesc) {
pCI = (xCharInfo *) pDesc->attach_addr;
if (stuff_flags & XF86Bigfont_FLAGS_Shm)
shmid = pDesc->shmid;
} else {
- if (stuff_flags & XF86Bigfont_FLAGS_Shm)
+ if (stuff_flags & XF86Bigfont_FLAGS_Shm && !badSysCall)
pDesc = shmalloc(nCharInfos * sizeof(xCharInfo)
+ sizeof(CARD32));
if (pDesc) {
@@ -522,7 +525,7 @@ ProcXF86BigfontQueryFont(
}
}
#ifdef HAS_SHM
- if (pDesc) {
+ if (pDesc && !badSysCall) {
*(CARD32 *)(pCI + nCharInfos) = signature;
if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) {
shmdealloc(pDesc);