diff --git a/tecs/logfile.c b/tecs/logfile.c index aaa4e38b..b99e5f13 100644 --- a/tecs/logfile.c +++ b/tecs/logfile.c @@ -21,6 +21,8 @@ static char *eptr=&ebuf[0]; static int lastStamp=0; static int notDated=0; +int ftime (struct timeb *__timeptr); /* for some reason not defined in timeb.h with flag -std1 */ + int logfileStd=0; int dirty=0; diff --git a/tecs/logfile.h b/tecs/logfile.h index a4b495b8..916073ae 100644 --- a/tecs/logfile.h +++ b/tecs/logfile.h @@ -1,14 +1,14 @@ #include "buf.h" void logfileInit(char *path, int nodate); -void logfileUpd(); +void logfileUpd(void); void logfileStamp(char *text); void logfileOut(char *fmt, ...); void logfileOutTmp(char *fmt, ...); void logfileOutBuf(buf_type *buf); void logfileShowErr(char *text); -void logfilePurge(); -void logfileWriteTmp(); -void logfileClose(); +void logfilePurge(void); +void logfileWriteTmp(void); +void logfileClose(void); extern int logfileStd; diff --git a/tecs/serutil.c b/tecs/serutil.c index b177c799..24702c9a 100644 --- a/tecs/serutil.c +++ b/tecs/serutil.c @@ -21,7 +21,7 @@ struct SerChan { char cmd[SER_BUF_LEN]; }; -void SerA_error() { +void SerA_error(void) { char *a_txt; int a_cod, a_my, a_vms; diff --git a/tecs/server.c b/tecs/server.c index 03b7734f..83a52ab2 100644 --- a/tecs/server.c +++ b/tecs/server.c @@ -1,3 +1,8 @@ +/* needed to define ftime(), accept() and gethostbyaddr() correctly when using flag -std1 */ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif + #include #include #include @@ -32,7 +37,7 @@ int CocInitServer(int bufsize, int port) { ERR_I(CocCreateSockAdr(&sadr, NULL, port)); ERR_SI(bind(mainFd, (struct sockaddr *)&sadr, sizeof(sadr))); logfileOut("created server on port %d\n", port); - ERR_SI(listen(mainFd, SOMAXCONN)); + ERR_SI(listen(mainFd, 8)); FD_ZERO(&mask); FD_SET(mainFd, &mask); maxfd=mainFd+1; diff --git a/tecs/server.h b/tecs/server.h index aa75eb89..38bfb50a 100644 --- a/tecs/server.h +++ b/tecs/server.h @@ -27,9 +27,9 @@ int CocHandle1Request(int tmo_msec, int fd); */ -struct CocClient *CocGetNextCmd(); +struct CocClient *CocGetNextCmd(void); /* get next client with a pending command */ -void CocCloseServer(); +void CocCloseServer(void);