36 lines
936 B
Plaintext
36 lines
936 B
Plaintext
$OpenBSD: patch-socketp_c,v 1.2 2012/08/06 20:45:49 naddy Exp $
|
|
--- socketp.c.orig Sun Aug 9 03:41:42 1992
|
|
+++ socketp.c Mon Aug 6 22:42:49 2012
|
|
@@ -13,8 +13,13 @@ Please read the file COPYRIGHT for further details.
|
|
#include <netinet/in.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 +57,7 @@ int port ;
|
|
{
|
|
struct sockaddr_in sa ;
|
|
struct hostent *hp ;
|
|
- int a, s ;
|
|
+ int s ;
|
|
long addr ;
|
|
|
|
|
|
@@ -76,7 +81,7 @@ int port ;
|
|
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 ;
|
|
}
|