public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] new_net compilation failure
@ 2002-07-10  4:08 Jani Monoses
  2002-07-10  5:21 ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Monoses @ 2002-07-10  4:08 UTC (permalink / raw)
  To: ecos-discuss

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.

the functions are in_rtchange & in_pcnbotifyall
Jani.

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] new_net compilation failure
  2002-07-10  4:08 [ECOS] new_net compilation failure Jani Monoses
@ 2002-07-10  5:21 ` Gary Thomas
  2002-07-10  5:28   ` Wolfgang Heppner
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gary Thomas @ 2002-07-10  5:21 UTC (permalink / raw)
  To: Jani Monoses; +Cc: eCos Discussion

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] new_net compilation failure
  2002-07-10  5:21 ` Gary Thomas
@ 2002-07-10  5:28   ` Wolfgang Heppner
  2002-07-10  5:35   ` Jani Monoses
  2002-07-10  5:39   ` Jani Monoses
  2 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Heppner @ 2002-07-10  5:28 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos-discuss

Gary Thomas wrote:
> 
> ...
> 
> So, why didn't I get any errors on these?  It seems that different
> compilers don't behave the same.
> 

What compiler are you using?
I got the same problem with gcc 2.95.2, configured for powerpc-eabi.


> Anyway, I'll commit this change which is better anyway.
> 

Thanks,
Wolfgang

-- 
Wolfgang Heppner

High Speed Kamerasysteme  - Abt. Bildsensorik (ESY-B)
High Speed Camera Systems - Dept. Electronic Imaging (ESY-B)

Fraunhofer                            
Institut Integrierte Schaltungen
Angewandte Elektronik

Am Wolfsmantel 33 
91058 Erlangen       
(Germany)

Tel:   +49 (0) 9131 776 528
Fax:   +49 (0) 9131 776 598

email: hep@iis.fhg.de
web:   http://www.iis.fhg.de

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] new_net compilation failure
  2002-07-10  5:21 ` Gary Thomas
  2002-07-10  5:28   ` Wolfgang Heppner
@ 2002-07-10  5:35   ` Jani Monoses
  2002-07-10  5:39   ` Jani Monoses
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Monoses @ 2002-07-10  5:35 UTC (permalink / raw)
  To: ecos-discuss

> So, why didn't I get any errors on these?  It seems that different
> compilers don't behave the same.

Ok with this patch it builds.

gcc version 2.95.3 20010315 (release)

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] new_net compilation failure
  2002-07-10  5:21 ` Gary Thomas
  2002-07-10  5:28   ` Wolfgang Heppner
  2002-07-10  5:35   ` Jani Monoses
@ 2002-07-10  5:39   ` Jani Monoses
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Monoses @ 2002-07-10  5:39 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss


> So, why didn't I get any errors on these?  It seems that different
> compilers don't behave the same.

Maybe some installations of gcc have different paths for sys/params.h ?????
I don't know.

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-07-10 12:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-10  4:08 [ECOS] new_net compilation failure Jani Monoses
2002-07-10  5:21 ` Gary Thomas
2002-07-10  5:28   ` Wolfgang Heppner
2002-07-10  5:35   ` Jani Monoses
2002-07-10  5:39   ` Jani Monoses

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).