1 --- debug.c 2004-09-07 11:50:01.000000000 +1000
2 +++ debug.c 2005-11-01 10:45:27.865300800 +1100
4 ttyp->proto==PROTO_PPP?"PPP":
8 lprint(" %d baudrate\r\n", ttyp->baud);
10 lprint(" interface is %s\r\n", ttyp->up?"up":"down");
11 lprint(" using fd %d, guardian pid is %d\r\n", ttyp->fd, ttyp->pid);
14 --- main.c 2004-09-07 12:25:39.000000000 +1000
15 +++ main.c 2005-11-27 22:13:00.651928000 +1100
19 Mainly for testing purposes, nice to be able to do fprintf(stderr...
21 + Includes Tim Watt's ttyname() fixes (modified)
26 int blnKeepErr, blnKeepStdOut;
27 + const char *ttyname_0_dup = 0;
28 + const char *ttyname_1_dup = 0;
29 + const char *ttyname_2_dup = 0;
31 +#define dup_ttyname(n) \
32 + if( (ttyname_##n##_dup = ttyname(n)) ) { \
33 + ttyname_##n##_dup = strdup(ttyname_##n##_dup); \
36 +#define clr_ttyname(n) \
37 + if( (ttyname_##n##_dup) ) { \
38 + free((char *) ttyname_##n##_dup); \
39 + ttyname_##n##_dup = 0; \
47 /* stderr going elsewhere ?? */
53 - if((slirp_tty == NULL && strcmp(ttyname(0), ttyname(2)) == 0) ||
54 - (slirp_tty != NULL && strcmp(ttyname(2), slirp_tty) == 0) )
55 + if((slirp_tty == NULL && ttyname_0_dup && ttyname_2_dup && strcmp(ttyname_0_dup, ttyname_2_dup) == 0) ||
56 + (slirp_tty != NULL && ttyname_2_dup && strcmp(ttyname_2_dup, slirp_tty) == 0) )
63 /* stdout going elsewhere ?? */
64 blnKeepStdOut = FALSE;
68 - if((slirp_tty == NULL && strcmp(ttyname(0), ttyname(1)) == 0) ||
69 - (slirp_tty != NULL && strcmp(ttyname(1), slirp_tty) == 0) )
70 + if((slirp_tty == NULL && ttyname_0_dup && ttyname_1_dup && strcmp(ttyname_0_dup, ttyname_1_dup) == 0) ||
71 + (slirp_tty != NULL && ttyname_1_dup && strcmp(ttyname_1_dup, slirp_tty) == 0) )
72 blnKeepStdOut = FALSE;
84 i = open("/dev/null", O_RDWR);
88 "1 Attached as unit %d, device %s\r\n\r\n[talking %s, %d baud]\r\n\r\nSLiRP Ready ...",
89 unit, device?device:"(socket)", buff2, ttyp->baud);
91 - snprintf(buff, sizeof(buff)
92 + snprintf(buff, sizeof(buff),
93 "1 Attached as unit %d, device %s\r\n\r\n[talking %s]\r\n\r\nSLiRP Ready ...",
97 --- main.h 2004-09-01 17:36:45.000000000 +1000
98 +++ main.h 2005-11-01 11:03:21.288808000 +1100
100 * terms and conditions of the copyright.
106 +#include <sys/types.h>
109 #ifdef HAVE_SYS_SELECT_H
110 #include <sys/select.h>
113 --- mbuf.c 2004-09-01 17:36:43.000000000 +1000
114 +++ mbuf.c 2006-01-08 12:00:20.843576000 +1100
115 @@ -146,18 +146,19 @@
121 /* some compiles throw up on gotos. This one we can fake. */
122 if(m->m_size>size) return;
124 if (m->m_flags & M_EXT) {
125 - /* datasize = m->m_data - m->m_ext; */
126 + datasize = m->m_data - m->m_ext;
127 m->m_ext = (char *)realloc(m->m_ext,size);
128 /* if (m->m_ext == NULL)
129 * return (struct mbuf *)NULL;
131 - /* m->m_data = m->m_ext + datasize; */
132 + m->m_data = m->m_ext + datasize;
136 datasize = m->m_data - m->m_dat;
137 dat = (char *)malloc(size);
139 --- version.h 2004-09-01 19:44:35.000000000 +1000
140 +++ version.h 2006-01-08 13:11:55.989692800 +1100
142 -#define SLIRP_VERSION "1.0.16"
143 +#define SLIRP_VERSION "1.0.17"
144 #define SLIRP_STATUS "BETA"