Socks5 version 1.0r7 on NEWS-OS Release 6.1.2

$B9=C[4D6-(J:(B
  (JNWS-5000TF(B
  (JNEWS-OS(B (JRelease(B (J6.1.2(B
  (JNEWS-C(B (J1.010(B
  (JGNU(B (Jmake(B (J3.77(B

$B%$%s%9%H!<%kJ}K!(J:(B
 % (Jpatch(B (J-p1(B (J<(B (JThisFile(B
 % ./configure --mandir=/usr/local/man/C --with-shadow-passwd
 % vi clients/telnet/Makefile
   -lsocket$B$N8e$K(B-lnsl$B$rDI2C(B
   $B5$J,E*$K(B-ltermcap --> -ltermlib
 % vi clients/ftp/Makefile
   -lsocket$B$N8e$K(B-lnsl$B$rDI2C(B

hiraga@meis.sony.co.jp

diff -urP socks5-v1.0r7/lib/select.c socks5-v1.0r7-newsos6/lib/select.c
--- socks5-v1.0r7/lib/select.c	Thu Oct  1 04:24:23 1998
+++ socks5-v1.0r7-newsos6/lib/select.c	Mon Oct 19 16:22:12 1998
@@ -124,7 +124,11 @@
         }
     }
 
+#if defined(__sony_news) && defined(__svr4)
+    if (timeout) gettimeofday(&start);
+#else
     if (timeout) gettimeofday(&start, NULL);
+#endif
 
     for (;;) {
 	if (rfdsp) memcpy(rfdsp, &rfs, size);
@@ -191,7 +195,11 @@
 	}
 
 	if (!timeout) continue;
+#if defined(__sony_news) && defined(__svr4)
+	gettimeofday(&end);
+#else
 	gettimeofday(&end, NULL);
+#endif
 
 	timeout->tv_sec  -= (end.tv_sec  - start.tv_sec);
 	timeout->tv_usec -= (end.tv_usec - start.tv_usec);
diff -urP socks5-v1.0r7/lib/wrap.c socks5-v1.0r7-newsos6/lib/wrap.c
--- socks5-v1.0r7/lib/wrap.c	Thu Oct  1 04:24:22 1998
+++ socks5-v1.0r7-newsos6/lib/wrap.c	Mon Oct 19 16:39:19 1998
@@ -249,16 +249,16 @@
     switch (lsSocketType(sd, NULL)) {
 
 		case SOCK_DGRAM:
-			S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+			S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS recv: FAKE: Udp");
-			DLRETURN(lsInWrapFunction, rval, \
+			DLRETURN(lsInWrapFunction, rval,
 					lsUdpRecvfrom(sd, msg, len, flags, from, fromlen, 0));
     	case SOCK_STREAM:
         	S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0, "SOCKS recv: FAKE: Tcp");
-        	DLRETURN(lsInWrapFunction, rval, \
+        	DLRETURN(lsInWrapFunction, rval,
 						lsTcpRecvfrom(sd, msg, len, flags, from, fromlen));
     	default:
-			S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+			S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS recv: REAL: Wrong type");	
 			SETSOCKETERROR(EBADF);
 			DLRETURN(lsInWrapFunction, rval, -1);
@@ -282,17 +282,17 @@
  
     switch (lsSocketType(sd, NULL)) {
 		case SOCK_DGRAM:
-            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS recvmsg: FAKE: Udp");
             DLRETURN(lsInWrapFunction, rval, lsUdpRecvmsg(sd, msg, flags));
 
         case SOCK_STREAM:
-            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS recvmsg: FAKE: Tcp");
             DLRETURN(lsInWrapFunction, rval, lsTcpRecvmsg(sd, msg, flags));
 
         default:
-            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS recvmsg: REAL: Wrong type");
 			SETSOCKETERROR(EBADF);
             DLRETURN(lsInWrapFunction, rval, -1);
@@ -316,17 +316,17 @@
     switch (lsSocketType(sd, NULL)) {
 
         case SOCK_DGRAM:
-            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS sendmsg: FAKE: Udp");
             DLRETURN(lsInWrapFunction, rval, lsUdpSendmsg(sd, msg, flags));
 
         case SOCK_STREAM:
-            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS sendmsg: FAKE: Tcp");
             DLRETURN(lsInWrapFunction, rval, lsTcpSendmsg(sd, msg, flags));
 
         default:
-            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+            S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 						"SOCKS sendmsg: REAL: Wrong type");
 			SETSOCKETERROR(EBADF);
             DLRETURN(lsInWrapFunction, rval, -1);
diff -urP socks5-v1.0r7/lib/wrap_tcp.c socks5-v1.0r7-newsos6/lib/wrap_tcp.c
--- socks5-v1.0r7/lib/wrap_tcp.c	Thu Oct  1 04:24:25 1998
+++ socks5-v1.0r7-newsos6/lib/wrap_tcp.c	Mon Oct 19 16:39:43 1998
@@ -676,7 +676,7 @@
  
     else
     if(pcon->status != CON_ESTABLISHED) {
-     S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,\
+     S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(12), 0,
 					"TcpSendmsg: Nonblocking connect error: %m");
      SETSOCKETERROR(EBADF);
      return -1;
diff -urP socks5-v1.0r7/lib/wrap_udp.c socks5-v1.0r7-newsos6/lib/wrap_udp.c
--- socks5-v1.0r7/lib/wrap_udp.c	Thu Oct  1 04:24:25 1998
+++ socks5-v1.0r7-newsos6/lib/wrap_udp.c	Mon Oct 19 16:40:10 1998
@@ -469,12 +469,12 @@
     else
      lsAddrCopy(&dst, (S5NetAddr *)to, lsAddrSize((S5NetAddr *)to));
  
-    S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0,"SOCKSsendmsg %s:%d..",\
+    S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0,"SOCKSsendmsg %s:%d..",
                 ADDRANDPORT(&dst));
 
     /* only ok to sendmsg() the person we're connected to.   */
  
-    if(pcon&&(pcon->status == CON_ESTABLISHED || \
+    if(pcon&&(pcon->status == CON_ESTABLISHED ||
              pcon->status == CON_ESTABLISHEDSEND)) {
      if(!ADDRCOMP((ssi *)to, &pcon->peer.sin)) {
       SETSOCKETERROR(EISCONN);
@@ -487,7 +487,7 @@
     /* No udp association for this socket, so send directly     */
  
     if((pcon = lsLibProtoExchg(s, &dst, SOCKS_UDP)) == NULL) {
-     S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0,\
+     S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0,
                     "lsUdpSendmsg: Protocol exchange failed");
      SETSOCKETERROR(EBADF);
      return -1;
@@ -538,7 +538,7 @@
     }
  
     if(!pcon || pcon->cmd != SOCKS_UDP) {
-     S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0,\
+     S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0,
                 "No valid connection found, returning direct recvmsg");
      return REAL(recvmsg)(s, msg, flags);
     }
@@ -570,7 +570,7 @@
  
     /* verify the contents as being from the right person */
 
-     if((pri = (lsProxyCacheFind(pcon, (S5NetAddr *)from,SOCKS5_VERSION, 1))) == NULL || \
+     if((pri = (lsProxyCacheFind(pcon, (S5NetAddr *)from,SOCKS5_VERSION, 1))) == NULL ||
 		pri->how != SOCKS5_VERSION) {
       S5LogUpdate(S5LogDefaultHandle, S5_LOG_DEBUG(10), 0, "Direct recvmsg (%x;%d)", pri, pri?pri->how:0);
       goto done;
