Skip to content
Snippets Groups Projects
Commit d2876e9d authored by rswindell's avatar rswindell
Browse files

Output semaphore is created immediately after socket descriptor is read.

parent 58117737
No related branches found
No related tags found
No related merge requests found
......@@ -1875,6 +1875,23 @@ void initdata(void)
str[0]=0;
fgets(str,81,stream);
client_socket=atoi(str);
if(client_socket!=INVALID_SOCKET) {
#ifdef _WIN32
output_sem=CreateEvent(
NULL // pointer to security attributes
,TRUE // flag for manual-reset event
,FALSE // flag for initial state
,NULL // pointer to event-object name
);
if(output_sem==NULL) {
printf("\r\n\7Error %d creating output_event\r\n",GetLastError());
exit(1);
}
#endif
_beginthread(output_thread,0,NULL);
}
#endif
fclose(stream);
......@@ -1883,15 +1900,16 @@ void initdata(void)
if(fexist(str)) {
if((stream=fopen(str,"rt"))==NULL) {
printf("Can't open %s\n",str);
exit(1); }
exit(1);
}
fgets(tmp,81,stream); /* so get MSR address from file */
msr=(uint FAR16 *)atol(tmp);
fclose(stream);
remove(str); }
remove(str);
}
starttime=time(NULL); /* initialize start time stamp */
wordwrap[0]=0; /* set wordwrap to null */
attr(LIGHTGRAY); /* initialize color and curatr to plain */
mnehigh=LIGHTGRAY|HIGH; /* mnemonics highlight color */
mnelow=GREEN; /* mnemonics normal text color */
sec_warn=180; /* seconds till inactivity warning */
......@@ -1904,13 +1922,15 @@ void initdata(void)
sprintf(str,"%s%s",ctrl_dir,"NODE.DAB");
if((nodefile=sopen(str,O_BINARY|O_RDWR,SH_DENYNO))==-1) {
bprintf("\r\n\7Error opening %s\r\n",str);
exit(1); }
printf("\r\n\7Error opening %s\r\n",str);
exit(1);
}
sprintf(str,"%sUSER\\NAME.DAT",data_dir);
if((i=nopen(str,O_RDONLY))==-1) {
printf("\r\n\7Error opening %s\r\n",str);
exit(1); }
exit(1);
}
memset(str,0,30);
read(i,str,26);
close(i);
......@@ -1923,31 +1943,14 @@ void initdata(void)
_termios_setup();
#endif
#ifndef __16BIT__
if(client_socket!=INVALID_SOCKET) {
#ifdef _WIN32
output_sem=CreateEvent(
NULL // pointer to security attributes
,TRUE // flag for manual-reset event
,FALSE // flag for initial state
,NULL // pointer to event-object name
);
if(output_sem==NULL) {
printf("\r\n\7Error %d creating output_event\r\n",GetLastError());
exit(1);
}
#endif
_beginthread(output_thread,0,NULL);
#endif
}
if(xsdk_mode&XSDK_MODE_NOCONSOLE) {
con_fp=NULL;
#ifdef _WIN32
FreeConsole();
#endif
}
attr(LIGHTGRAY); /* initialize color and curatr to plain */
}
/****************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment