Usermode - Renamed VFS syscalls to _Sys* to remove POSIX collisions
[tpg/acess2.git] / Usermode / Applications / axwin3_src / libaxwin3.so_src / msg.c
index e9003e1..a1f5b78 100644 (file)
@@ -33,9 +33,8 @@ tAxWin3_MessageCallback       gAxWin3_MessageCallback;
 // === CODE ===
 void AxWin3_Connect(const char *ServerDesc)
 {
-       _SysDebug("ServerDesc = %s", ServerDesc);
-       if( !ServerDesc )
-       {
+       _SysDebug("ServerDesc (argument) = %s", ServerDesc);
+       if( !ServerDesc ) {
                ServerDesc = gsAxWin3_int_ServerDesc;
        }
        _SysDebug("ServerDesc = %s", ServerDesc);
@@ -50,6 +49,10 @@ void AxWin3_Connect(const char *ServerDesc)
        case '6': case '7': case '8': case '9': case '0':
                giConnectionType = CONNTYPE_SENDMESSAGE;
                giConnectionNum = atoi(ServerDesc);
+               if( giConnectionNum == 0 ) {
+                       _SysDebug("Invalid server PID");
+                       exit(-1);
+               }
                break;
        case 'u':
                while(*ServerDesc && *ServerDesc != ':')        ServerDesc ++;
@@ -104,11 +107,11 @@ void AxWin3_int_SendIPCMessage(tAxWin_IPCMessage *Msg)
                char    tmpbuf[giAxWin3_int_UDPHeaderLen + size];
                memcpy(tmpbuf, gaAxWin3_int_UDPHeader, giAxWin3_int_UDPHeaderLen);
                memcpy(tmpbuf + giAxWin3_int_UDPHeaderLen, Msg, size);
-               write(giConnectionNum, tmpbuf, sizeof(tmpbuf));
+               _SysWrite(giConnectionNum, tmpbuf, sizeof(tmpbuf));
                }
                break;
        case CONNTYPE_TCP:
-               write(giConnectionNum, Msg, size);
+               _SysWrite(giConnectionNum, Msg, size);
                break;
        default:
                break;
@@ -119,7 +122,7 @@ tAxWin_IPCMessage *AxWin3_int_GetIPCMessage(int nFD, fd_set *fds)
 {
         int    len;
        tAxWin_IPCMessage       *ret = NULL;
-       pid_t   tid;
+        int    tid;
 
        _SysSelect(nFD, fds, NULL, NULL, NULL, THREAD_EVENT_IPCMSG);
        

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