Index: xext/shm.c
===================================================================
RCS file: /cvs/xc/programs/Xserver/Xext/shm.c,v
retrieving revision 3.36
diff -u -3 -p -B -r3.36 shm.c
--- xext/shm.c	3 Apr 2002 19:51:11 -0000	3.36
+++ xext/shm.c	5 Sep 2003 08:43:47 -0000
@@ -190,7 +190,30 @@ static Bool CheckForShmSyscall()
     return(!badSysCall);
 }
 #endif
+
+#if defined(__CYGWIN__) 
+static Bool CheckForRunningIPCDaemon()
+{
+    int shmid = -1;
+    Bool runningDaemon = TRUE;  
     
+    shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
+
+    /* hard check condition, disable in case of any errors */ 
+    if (shmid < 0) 
+    {
+  runningDaemon = FALSE; 
+    }
+        
+    /* Clean up */
+    if (shmid > 0)
+    {
+  shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
+    }  
+    return runningDaemon; 
+}
+#endif
+
 void
 ShmExtensionInit()
 {
@@ -201,6 +224,14 @@ ShmExtensionInit()
     if (!CheckForShmSyscall())
     {
 	ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
+	return;
+    }
+#endif
+
+#if defined(__CYGWIN__) 
+    if (!CheckForRunningIPCDaemon())
+    {
+	ErrorF("MIT-SHM extension disabled due to not running ipc-daemon\n");
 	return;
     }
 #endif
