| @@ -1,17 +1,21 @@ | | | @@ -1,17 +1,21 @@ |
1 | $NetBSD: patch-ab,v 1.3 2007/10/01 11:02:45 rillig Exp $ | | 1 | $NetBSD: patch-ab,v 1.4 2012/05/23 07:19:23 dholland Exp $ |
2 | | | 2 | |
3 | --- main.c.orig 1998-10-01 01:58:17.000000000 +0200 | | 3 | - use standard headers |
4 | +++ main.c 2007-10-01 12:55:46.375715000 +0200 | | 4 | - fix solaris build |
| | | 5 | - fd_set isn't a struct |
| | | 6 | |
| | | 7 | --- main.c.orig 1998-09-30 23:58:17.000000000 +0000 |
| | | 8 | +++ main.c |
5 | @@ -33,16 +33,20 @@ | | 9 | @@ -33,16 +33,20 @@ |
6 | */ | | 10 | */ |
7 | | | 11 | |
8 | #include <sys/time.h> | | 12 | #include <sys/time.h> |
9 | +#include <err.h> | | 13 | +#include <err.h> |
10 | #include <stdio.h> | | 14 | #include <stdio.h> |
11 | #include <unistd.h> | | 15 | #include <unistd.h> |
12 | #include <stdlib.h> | | 16 | #include <stdlib.h> |
13 | #include <fcntl.h> | | 17 | #include <fcntl.h> |
14 | #include <termios.h> | | 18 | #include <termios.h> |
15 | #include <signal.h> | | 19 | #include <signal.h> |
16 | +#include <string.h> | | 20 | +#include <string.h> |
17 | #include <X11/X.h> | | 21 | #include <X11/X.h> |
| @@ -46,13 +50,22 @@ $NetBSD: patch-ab,v 1.3 2007/10/01 11:02 | | | @@ -46,13 +50,22 @@ $NetBSD: patch-ab,v 1.3 2007/10/01 11:02 |
46 | + raw.c_oflag &= ~OPOST; | | 50 | + raw.c_oflag &= ~OPOST; |
47 | + raw.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); | | 51 | + raw.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); |
48 | + raw.c_cflag &= ~(CSIZE|PARENB); | | 52 | + raw.c_cflag &= ~(CSIZE|PARENB); |
49 | + raw.c_cflag |= CS8; | | 53 | + raw.c_cflag |= CS8; |
50 | + cfsetispeed(&raw, B1200); | | 54 | + cfsetispeed(&raw, B1200); |
51 | + cfsetospeed(&raw, B1200); | | 55 | + cfsetospeed(&raw, B1200); |
52 | +#else | | 56 | +#else |
53 | cfmakeraw(&raw); | | 57 | cfmakeraw(&raw); |
54 | cfsetspeed(&raw, B1200); | | 58 | cfsetspeed(&raw, B1200); |
55 | +#endif | | 59 | +#endif |
56 | raw.c_cflag &= ~(CSIZE|PARENB|CSTOPB|MDMBUF); | | 60 | raw.c_cflag &= ~(CSIZE|PARENB|CSTOPB|MDMBUF); |
57 | raw.c_cflag |= CS8|CREAD|CLOCAL; | | 61 | raw.c_cflag |= CS8|CREAD|CLOCAL; |
58 | tcsetattr(fd, TCSANOW, &raw); | | 62 | tcsetattr(fd, TCSANOW, &raw); |
| | | 63 | @@ -183,7 +204,7 @@ mainloop(fd) |
| | | 64 | int fd; |
| | | 65 | { |
| | | 66 | struct timeval tv; |
| | | 67 | - struct fd_set rfd; |
| | | 68 | + fd_set rfd; |
| | | 69 | u_char buf[BUFSIZ]; |
| | | 70 | int nfd; |
| | | 71 | int len; |