aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/socket.c b/socket.c
index 24d86ee8..1a6c6047 100644
--- a/socket.c
+++ b/socket.c
@@ -26,13 +26,12 @@
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
-#if defined(QNX)
-#include <stdio.h>
+#if defined(HAVE_STDARG_H)
#include <stdarg.h>
#else
-#include <stdlib.h>
-#endif
#include <varargs.h>
+#endif
+#include <stdlib.h>
#include <errno.h>
#include "socket.h"
@@ -187,24 +186,15 @@ int len;
else {
bcopy(bp,buf,len);
sbuflen -= len;
-#if defined(QNX)
-int SockPrintf(int socket, char* format, ...)
-{
-#else
bp += len;
}
return(len);
}
-#endif
/* SockClearHeader: call this procedure in order to kill off any
forthcoming Header info from the socket that we no longer want.
*/
-#if defined(QNX)
- va_start(ap, format) ;
-#else
int SockClearHeader(socket)
-#endif
int socket;
{
char *bufp;
@@ -258,17 +248,26 @@ int SockDataWaiting(int socket)
fcntl(socket,F_SETFL,flags);
return res;
}
-
+#if defined(HAVE_STDARG_H)
+int SockPrintf(int socket, char* format, ...)
+{
+#else
int SockPrintf(socket,format,va_alist)
int socket;
char *format;
va_dcl {
+#endif
va_list ap;
char buf[8192];
-
+
+#if defined(HAVE_STDARG_H)
+ va_start(ap, format) ;
+#else
va_start(ap);
+#endif
vsprintf(buf, format, ap);
va_end(ap);
return SockWrite(socket, buf, strlen(buf));
+
}