$NetBSD: patch-ag,v 1.5 2006/06/21 15:15:16 minskim Exp $

--- Wnn/jlib/js.c.orig	1999-05-17 03:04:45.000000000 +0000
+++ Wnn/jlib/js.c
@@ -70,9 +70,8 @@ extern	Variables
 */
 
 
-extern	char	*malloc();
-
 #include <stdio.h>
+#include <stdlib.h>
 #include <ctype.h>
 #ifdef UX386
 #include <X11/Xos.h>
@@ -85,7 +84,6 @@ extern	char	*malloc();
 #endif
 #include <sys/stat.h>
 #include <errno.h>
-extern int errno;
 #include <signal.h>
 #include "jd_sock.h"
 #include "commonhd.h"
@@ -103,8 +101,6 @@ extern int errno;
 #include "../etc/bdic.c"
 #include "../etc/pwd.c"
 
-char *malloc();
-
 #ifdef SYSVR2
 #define	bzero(adr,n)	memset((adr),0,(n))
 #endif
@@ -220,11 +216,11 @@ register char *lang;
 #endif
 	return -1;
     }
-#if !(defined(BSD) && (BSD >= 199306)) /* !4.4BSD-Lite */
-    if (connect(sd,(struct sockaddr *)&saddr,strlen(saddr.sun_path)+sizeof(saddr.sun_family)) == ERROR) {
-#else /* 4.4BSD-Lite */
+
+#if !defined(SUN_LEN)
+# define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif
     if (connect(sd,(struct sockaddr *)&saddr,SUN_LEN(&saddr)) == ERROR) {
-#endif /* 4.4BSD-Lite */
 
 #if DEBUG
 	xerror("jslib:Can't connect socket.\n");
