=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/plugin/mytcpio.c,v retrieving revision 1.14 retrieving revision 1.17 diff -u -p -r1.14 -r1.17 --- OpenXM/src/kan96xx/plugin/mytcpio.c 2004/02/28 13:39:42 1.14 +++ OpenXM/src/kan96xx/plugin/mytcpio.c 2020/10/06 11:33:47 1.17 @@ -1,5 +1,6 @@ -/* $OpenXM: OpenXM/src/kan96xx/plugin/mytcpio.c,v 1.13 2004/02/25 23:14:35 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/plugin/mytcpio.c,v 1.16 2005/07/03 11:08:54 ohara Exp $ */ #include +#include #include #include #include @@ -7,6 +8,7 @@ #include #include #include +#include /* -lnsl -lsocket /usr/ucblib/libucb.a */ #include "ox_kan.h" /* @@ -34,7 +36,7 @@ FILE *TcpioError = NULL; int OpenedSocket = 0; extern int Quiet; -socketOpen(char *serverName,int portNumber) { +int socketOpen(char *serverName,int portNumber) { static struct hostent *myhost; static struct sockaddr_in me; static int s_waiting; @@ -84,12 +86,12 @@ socketOpen(char *serverName,int portNumber) { } -socketAccept(int snum) { +int socketAccept(int snum) { int s, news; SET_TCPIOERROR; s = snum; - if (!Quiet) fprintf(TcpioError,"Trying to accept... "); fflush(TcpioError); + if (!Quiet) {fprintf(TcpioError,"Trying to accept... "); fflush(TcpioError);} if ((news = accept(s,NULL,NULL)) < 0) { errorMsg1s("Error in accept. Retrying (socketAccept)."); /* Code added for strange behavior on cygwin. */ @@ -98,7 +100,7 @@ socketAccept(int snum) { return (-1); } } - if (!Quiet) fprintf(TcpioError,"Accepted.\n"); fflush(TcpioError); + if (!Quiet) {fprintf(TcpioError,"Accepted.\n"); fflush(TcpioError);} if (close(s) < 0) { errorMsg1s("Error in closing the old socket."); return(-1); @@ -106,7 +108,7 @@ socketAccept(int snum) { return(news); } -socketAcceptLocal(int snum) { +int socketAcceptLocal(int snum) { int s, news; struct sockaddr peer; int len; @@ -114,7 +116,7 @@ socketAcceptLocal(int snum) { SET_TCPIOERROR; s = snum; - if (!Quiet) fprintf(TcpioError,"Trying to accept from localhost... "); fflush(TcpioError); + if (!Quiet) {fprintf(TcpioError,"Trying to accept from localhost... "); fflush(TcpioError);} len = sizeof(struct sockaddr); if ((news = accept(s,&peer,&len)) < 0) { errorMsg1s("Error in accept. Retrying"); @@ -131,7 +133,7 @@ socketAcceptLocal(int snum) { for (i=0; i