Branch oldpackages for 14.07
[14.07/packages.git] / net / serialoverip / patches / 001-compile-fixes.patch
1 diff -ur serialoverip-1.0.orig/serialoverip.c serialoverip-1.0/serialoverip.c
2 --- serialoverip-1.0.orig/serialoverip.c        2009-09-24 19:32:40.000000000 +0200
3 +++ serialoverip-1.0/serialoverip.c     2009-09-24 19:43:18.000000000 +0200
4 @@ -34,6 +34,7 @@
5  #include <fcntl.h>
6  #include <termios.h>
7  #include <signal.h>
8 +#include <strings.h>
9  
10  #define MAXMESG 2048
11  
12 @@ -42,20 +43,19 @@
13  int s[2],st[2];
14  
15  void help(){
16 -       fprintf(stderr,"\
17 -SerialOverIP version 1.0, Copyright (C) 2002 Stefan-Florin Nicola <sten@fx.ro>
18 -SerialOverIP comes with ABSOLUTELY NO WARRANTY. This is free software, and you
19 -are welcome to redistribute it under GNU General Public License.
20 - Usage: %s <source1> <source2>
21 -  where <source1> and <source2> are one of the folowing:
22 -    -s <IP> <port>                 UDP server on IP:port
23 -    -c <IP> <port>                 UDP client for server IP:port
24 -    -d <device> sss-dps            local serial device
25 -       sss is speed (50,..,230400)
26 -       d is data bits (5,6,7,8)
27 -       p is parity type (N,E,O)
28 -       s is stop bits (1,2)
29 -",pname);
30 +       fprintf(stderr,
31 +"SerialOverIP version 1.0, Copyright (C) 2002 Stefan-Florin Nicola <sten@fx.ro>\n"
32 +"SerialOverIP comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n"
33 +"are welcome to redistribute it under GNU General Public License.\n"
34 +" Usage: %s <source1> <source2>\n"
35 +"  where <source1> and <source2> are one of the folowing:\n"
36 +"    -s <IP> <port>                 UDP server on IP:port\n"
37 +"    -c <IP> <port>                 UDP client for server IP:port\n"
38 +"    -d <device> sss-dps            local serial device\n"
39 +"       sss is speed (50,..,230400)\n"
40 +"       d is data bits (5,6,7,8)\n"
41 +"       p is parity type (N,E,O)\n"
42 +"       s is stop bits (1,2)\n", pname);
43         return;
44  }
45  
46 @@ -113,10 +113,9 @@
47  
48  int main(int argc,char**argv){
49         int i,n,w,clen[2],nonblock[2],speed,data,stopb;
50 -       unsigned char c,buf[MAXMESG],*p,parity;
51 +       unsigned char buf[MAXMESG],*p,parity;
52         struct termios cfg;
53         struct sockaddr_in addr[4][4];
54 -       struct sigaction newact,oldact;
55  
56         pname=argv[0];
57         if(argc!=7){
58 @@ -156,7 +155,7 @@
59                         n=sscanf(argv[3*i+3],"%d-%d%c%d",&speed,&data,&parity,&stopb);
60                         if(n<4){
61                                 fprintf(stderr,"%s: invalid argument %1d from %s\n",
62 -                                               pname,read+1,argv[3*i+3]);
63 +                                               pname,(int)(read+1),argv[3*i+3]);
64                                 return 3;
65                         }
66                         if(setserial(s[i],&cfg,speed,data,parity,stopb)<0){
67 @@ -177,7 +176,7 @@
68                 if(st[i]&2)n=read(s[i],buf,MAXMESG);
69                 else{
70                         n=recvfrom(s[i],buf,MAXMESG,nonblock[i]*MSG_DONTWAIT,
71 -                                       (struct sockaddr*)&addr[i][st[i]],&clen[i]);
72 +                                       (struct sockaddr*)&addr[i][st[i]],(socklen_t *)&clen[i]);
73                         nonblock[i]=1;
74                 }
75                 p=buf;
76 Only in serialoverip-1.0: serialoverip.new