Merge branch 'master' of ted.mutabah.net:acess2
[tpg/acess2.git] / Usermode / Applications / axwin3_src / libaxwin3.so_src / msg.c
index 17d089f..2b50167 100644 (file)
@@ -16,6 +16,7 @@
 // === CONSTANTS ===
 enum eConnectionType
 {
+       CONNTYPE_NONE,
        CONNTYPE_SENDMESSAGE,
        CONNTYPE_UDP,
        CONNTYPE_TCP
@@ -121,11 +122,16 @@ tAxWin_IPCMessage *AxWin3_int_GetIPCMessage(void)
        switch(giConnectionType)
        {
        case CONNTYPE_SENDMESSAGE:
-               _SysWaitEvent(THREAD_EVENT_IPCMSG);
-               while(SysGetMessage(NULL, NULL))
+               for( ;; )
                {
                        pid_t   tid;
-                       len = SysGetMessage(&tid, NULL);
+               
+                       // Wait for a message to arrive 
+                       while( !(len = SysGetMessage(&tid, NULL)) )
+                       {
+                               _SysWaitEvent(THREAD_EVENT_IPCMSG);
+                       }
+                       
                        // Check if the message came from the server
                        if(tid != giConnectionNum)
                        {

UCC git Repository :: git.ucc.asn.au