Bugzilla #1883 (https://freedesktop.org/bugzilla/show_bug.cgi?id=1883): Fix
authorThomas Hellstrom <unichrome@shipmail.org>
Tue, 23 Nov 2004 17:29:47 +0000 (17:29 +0000)
committerThomas Hellstrom <unichrome@shipmail.org>
Tue, 23 Nov 2004 17:29:47 +0000 (17:29 +0000)
    insufficient SHM detection in XvMC local test. Removed reference to
    getpagesize() which caused linking problems on s390. Reported by Stefan
    Dirsch <sndirsh@suse.de>

src/XvMC.c

index e022ad9..8db6409 100644 (file)
@@ -5,9 +5,14 @@
 #include <stdio.h>
 #include "XvMClibint.h"
 #ifdef HAS_SHM
+#ifndef Lynx
 #include <sys/ipc.h>
 #include <sys/shm.h>
-#endif
+#else
+#include <ipc.h>
+#include <shm.h>
+#endif /* Lynx */
+#endif /* HAS_SHM */
 #include <unistd.h>
 #include <sys/time.h>
 #include <X11/extensions/Xext.h>
@@ -500,7 +505,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
     magic = 0;
     req->magic = 0;
 #ifdef HAS_SHM 
-    req->shmKey = shmget(IPC_PRIVATE, getpagesize(), IPC_CREAT | 0600);
+    req->shmKey = shmget(IPC_PRIVATE, 1024, IPC_CREAT | 0600);
 
     /*
      * We fill a shared memory page with a repetitive pattern. If the
@@ -522,7 +527,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
            gettimeofday( &now, &here);
            magic = now.tv_usec & 0x000FFFFF;
            req->magic = magic;
-           i = getpagesize() / sizeof(CARD32);
+           i = 1024 / sizeof(CARD32);
            while(i--) {
                *shMemC++ = magic; 
                magic = ~magic;