summaryrefslogtreecommitdiff
path: root/net/bounce/files/patch-01
blob: 3a75997b9af877bf9c1e0a90f54e08379ab44597 (plain) (blame)
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
--- bounce.c.orig	Tue Sep 28 08:20:32 1999
+++ bounce.c	Tue Sep 28 08:22:33 1999
@@ -20,13 +20,14 @@
 #include <sys/ioctl.h>
 #include <signal.h>
 #include <sys/wait.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define    QLEN           5
 #define    DEFAULT_PORT   1523
 
 char sbuf[16384], cbuf[16384];
-extern int errno;
-extern char *sys_errlist[];
 
 void sigchld() {
   signal(SIGCHLD, sigchld);
@@ -182,7 +183,7 @@
     srv_addr.sin_addr.s_addr=htonl(INADDR_ANY);
     srv_addr.sin_port=htons(myport);
     srv_fd=socket(PF_INET,SOCK_STREAM,0);
-    if (bind(srv_fd,&srv_addr,sizeof(srv_addr))==-1) {
+    if (bind(srv_fd,(struct sockaddr *)&srv_addr,sizeof(srv_addr))==-1) {
 	perror("bind");
         exit(-1);
     }
@@ -202,7 +203,7 @@
     if (fork()) exit(0);
     while (1) {
 	len=sizeof(rem_addr);
-	rem_fd=accept(srv_fd,&rem_addr,&len);
+	rem_fd=accept(srv_fd,(struct sockaddr *)&rem_addr,&len);
 	if (rem_fd<0) {
 	  if (errno==EINTR) continue;
 	  exit(-1);