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
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)
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);
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;
53 struct sockaddr_in addr[4][4];
54 - struct sigaction newact,oldact;
59 n=sscanf(argv[3*i+3],"%d-%d%c%d",&speed,&data,&parity,&stopb);
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]);
66 if(setserial(s[i],&cfg,speed,data,parity,stopb)<0){
68 if(st[i]&2)n=read(s[i],buf,MAXMESG);
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]);
76 Only in serialoverip-1.0: serialoverip.new