summaryrefslogtreecommitdiff
path: root/sysutils/socket/patches/patch-ah
blob: d80886fdfe74a0d3e757d54587f0b10daef43aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$NetBSD: patch-ah,v 1.1 1999/02/02 23:00:41 tron Exp $

--- socketp.c.orig	Sun Aug  9 03:41:42 1992
+++ socketp.c	Tue Feb  2 23:52:03 1999
@@ -11,10 +11,16 @@
 #include <sys/socket.h>
 #include <sys/errno.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include "globals.h"
 
+extern int is_number A((char *));
+
 /*
  * create a server socket on PORT accepting QUEUE_LENGTH connections
  */
@@ -52,7 +58,7 @@
 {
     struct sockaddr_in sa ;
     struct hostent *hp ;
-    int a, s ;
+    int s ;
     long addr ;
 
 
@@ -76,7 +82,7 @@
     if ((s = socket(sa.sin_family, SOCK_STREAM, 0)) < 0) { /* get socket */
 	return -1 ;
     }
-    if (connect(s, &sa, sizeof(sa)) < 0) {                  /* connect */
+    if (connect(s, (struct sockaddr *)&sa, sizeof(sa)) < 0) { /* connect */
 	close(s) ;
 	return -1 ;
     }