This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: new_net compilation failure
- From: Gary Thomas <gary at chez-thomas dot org>
- To: Jani Monoses <jani at iv dot ro>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 10 Jul 2002 06:20:59 -0600
- Subject: Re: [ECOS] new_net compilation failure
- References: <20020710140837.6eb896b4.jani@iv.ro>
On Wed, 2002-07-10 at 08:08, Jani Monoses wrote:
> now that sys/param.h includes errno.h which #defines errno
> net/bsd_tcpip/src/sys/netinet/in_pcb.c won't build because some functions
> have errno as a parameter name.That expands to the errno define and gives
> several syntax errors.
>
> I am just using the plain new_net template with no further config.
>
> The solution would be either reverting the change and including errno.h only in the two files which needed
> it or renaming the parameters.
>
I just put it there to be closer to the old stack behavior.
> the functions are in_rtchange & in_pcnbotifyall
So, why didn't I get any errors on these? It seems that different
compilers don't behave the same.
Anyway, I'll commit this change which is better anyway.
Index: net/bsd_tcpip/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.5
diff -u -5 -p -r1.5 ChangeLog
--- net/bsd_tcpip/current/ChangeLog 8 Jul 2002 20:54:12 -0000 1.5
+++ net/bsd_tcpip/current/ChangeLog 10 Jul 2002 12:20:08 -0000
@@ -1,5 +1,12 @@
+2002-07-10 Gary Thomas <gary@chez-thomas.org>
+
+ * src/sys/netinet/udp_usrreq.c:
+ * src/sys/netinet/tcp_subr.c:
+ * src/sys/netinet/in_pcb.c: Rename 'errno' function parameter
+ since some compilers have problems with this.
+
2002-07-08 Gary Thomas <gary@chez-thomas.org>
* include/sys/param.h: Need <errno.h> which may or may not be
already present, depending on configuration.
Index: net/bsd_tcpip/current/src/sys/netinet/in_pcb.c
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/in_pcb.c,v
retrieving revision 1.1
diff -u -5 -p -r1.1 in_pcb.c
--- net/bsd_tcpip/current/src/sys/netinet/in_pcb.c 20 May 2002 22:25:02 -0000 1.1
+++ net/bsd_tcpip/current/src/sys/netinet/in_pcb.c 10 Jul 2002 12:15:31 -0000
@@ -579,11 +579,11 @@ in_setpeeraddr(so, nam)
*nam = (struct sockaddr *)sin;
return 0;
}
void
-in_pcbnotifyall(head, faddr, errno, notify)
+in_pcbnotifyall(head, faddr, _errno, notify)
struct inpcbhead *head;
struct in_addr faddr;
void (*notify) __P((struct inpcb *, int));
{
struct inpcb *inp, *ninp;
@@ -597,11 +597,11 @@ in_pcbnotifyall(head, faddr, errno, noti
continue;
#endif
if (inp->inp_faddr.s_addr != faddr.s_addr ||
inp->inp_socket == NULL)
continue;
- (*notify)(inp, errno);
+ (*notify)(inp, _errno);
}
splx(s);
}
void
@@ -678,13 +678,13 @@ in_losing(inp)
/*
* After a routing change, flush old routing
* and allocate a (hopefully) better one.
*/
void
-in_rtchange(inp, errno)
+in_rtchange(inp, _errno)
register struct inpcb *inp;
- int errno;
+ int _errno;
{
if (inp->inp_route.ro_rt) {
rtfree(inp->inp_route.ro_rt);
inp->inp_route.ro_rt = 0;
/*
Index: net/bsd_tcpip/current/src/sys/netinet/tcp_subr.c
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.1
diff -u -5 -p -r1.1 tcp_subr.c
--- net/bsd_tcpip/current/src/sys/netinet/tcp_subr.c 20 May 2002 22:25:02 -0000 1.1
+++ net/bsd_tcpip/current/src/sys/netinet/tcp_subr.c 10 Jul 2002 12:16:59 -0000
@@ -531,25 +531,25 @@ tcp_newtcpcb(inp)
* Drop a TCP connection, reporting
* the specified error. If connection is synchronized,
* then send a RST to peer.
*/
struct tcpcb *
-tcp_drop(tp, errno)
+tcp_drop(tp, _errno)
register struct tcpcb *tp;
- int errno;
+ int _errno;
{
struct socket *so = tp->t_inpcb->inp_socket;
if (TCPS_HAVERCVDSYN(tp->t_state)) {
tp->t_state = TCPS_CLOSED;
(void) tcp_output(tp);
tcpstat.tcps_drops++;
} else
tcpstat.tcps_conndrops++;
- if (errno == ETIMEDOUT && tp->t_softerror)
- errno = tp->t_softerror;
- so->so_error = errno;
+ if (_errno == ETIMEDOUT && tp->t_softerror)
+ _errno = tp->t_softerror;
+ so->so_error = _errno;
return (tcp_close(tp));
}
/*
* Close a TCP control block:
@@ -1000,13 +1000,13 @@ tcp_new_isn(tp)
/*
* When a source quench is received, close congestion window
* to one segment. We will gradually open it again as we proceed.
*/
void
-tcp_quench(inp, errno)
+tcp_quench(inp, _errno)
struct inpcb *inp;
- int errno;
+ int _errno;
{
struct tcpcb *tp = intotcpcb(inp);
if (tp)
tp->snd_cwnd = tp->t_maxseg;
@@ -1016,30 +1016,30 @@ tcp_quench(inp, errno)
* When a specific ICMP unreachable message is received and the
* connection state is SYN-SENT, drop the connection. This behavior
* is controlled by the icmp_may_rst sysctl.
*/
void
-tcp_drop_syn_sent(inp, errno)
+tcp_drop_syn_sent(inp, _errno)
struct inpcb *inp;
- int errno;
+ int _errno;
{
struct tcpcb *tp = intotcpcb(inp);
if (tp && tp->t_state == TCPS_SYN_SENT)
- tcp_drop(tp, errno);
+ tcp_drop(tp, _errno);
}
/*
* When `need fragmentation' ICMP is received, update our idea of the MSS
* based on the new value in the route. Also nudge TCP to send something,
* since we know the packet we just sent was dropped.
* This duplicates some code in the tcp_mss() function in tcp_input.c.
*/
void
-tcp_mtudisc(inp, errno)
+tcp_mtudisc(inp, _errno)
struct inpcb *inp;
- int errno;
+ int _errno;
{
struct tcpcb *tp = intotcpcb(inp);
struct rtentry *rt;
struct rmxp_tao *taop;
struct socket *so = inp->inp_socket;
Index: net/bsd_tcpip/current/src/sys/netinet/udp_usrreq.c
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/udp_usrreq.c,v
retrieving revision 1.1
diff -u -5 -p -r1.1 udp_usrreq.c
--- net/bsd_tcpip/current/src/sys/netinet/udp_usrreq.c 20 May 2002 22:25:02 -0000 1.1
+++ net/bsd_tcpip/current/src/sys/netinet/udp_usrreq.c 10 Jul 2002 12:16:03 -0000
@@ -512,15 +512,15 @@ udp_append(last, ip, n, off)
/*
* Notify a udp user of an asynchronous error;
* just wake up so that he can collect error status.
*/
void
-udp_notify(inp, errno)
+udp_notify(inp, _errno)
register struct inpcb *inp;
- int errno;
+ int _errno;
{
- inp->inp_socket->so_error = errno;
+ inp->inp_socket->so_error = _errno;
sorwakeup(inp->inp_socket);
sowwakeup(inp->inp_socket);
}
void
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss