*/
int main(int argc, char *argv[])
{
- int server_tid = gettid();
-
ParseCommandline(argc, argv);
if( gsTerminalDevice == NULL ) {
WM_Hotkey_Register(2, keys, "Interface>Run");
// Spawn interface root
- if( clone(CLONE_VM, 0) == 0 )
{
+ int server_tid = gettid();
+ _SysDebug("server_tid = %i", server_tid);
static char csInterfaceApp[] = __INSTALL_ROOT"/AxWinUI";
char server_info[] = "AXWIN3_SERVER=00000";
- char *envp[] = {server_info, NULL};
- char *argv[] = {csInterfaceApp, NULL};
+ const char *envp[] = {server_info, NULL};
+ const char *argv[] = {csInterfaceApp, NULL};
_SysDebug("server_tid = %i, &server_tid = %p", server_tid, &server_tid);
sprintf(server_info, "AXWIN3_SERVER=%i", server_tid);
- execve(csInterfaceApp, argv, envp);
- exit(1);
+ // TODO: Does the client need FDs?
+ int rv = _SysSpawn(csInterfaceApp, argv, envp, 0, NULL, NULL);
+ if( rv ) {
+ _SysDebug("_SysSpawn chucked a sad, rv=%i, errno=%i", rv, _errno);
+ }
}
// Main Loop
// === 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);
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 ++;