This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
FWD: Re: [ECOS] Problems with init_all_network_interfaces
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: eCos Patches <ecos-patches at sources dot redhat dot com>
- Date: Fri, 11 Jul 2003 11:32:02 +0200
- Subject: FWD: Re: [ECOS] Problems with init_all_network_interfaces
> Date: Fri, 11 Jul 2003 11:10:48 +0200
> From: Eric Doenges <Eric.Doenges@DynaPel.de>
> To: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] Problems with init_all_network_interfaces
>
> I've managed to figure out what is going wrong here -- I have several
> configurations of eCos I'm working on, and I specified the wrong
> path, so the wrong 'extras.o' (without the FreeBSD stack) got linked in.
> Due to the way this is done with Equator's tools, it did link with the
> correct libtarget, making this error difficult to detect.
>
> The crash was then caused by the function 'socket' in
> io/fileio/current/src/socket.cxx, which returns an invalid cyg_file
> instead of an error when no networking stack exists (nstab is empty).
This patch should solve this problem. socket will return EINVAL.
Andrew
Index: io/fileio/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/fileio/current/ChangeLog,v
retrieving revision 1.31
diff -u -r1.31 ChangeLog
--- io/fileio/current//ChangeLog 11 Apr 2003 02:06:11 -0000 1.31
+++ io/fileio/current//ChangeLog 11 Jul 2003 09:29:53 -0000
@@ -1,3 +1,8 @@
+2003-07-11 Andrew Lunn <andrew.lunn@ascom.ch>
+
+ * src/socket.cxx (socket): If there are no network stacks configured
+ return EINVAL when opening a socket.
+
2003-04-11 Jonathan Larmour <jifl@eCosCentric.com>
* src/socket.cxx: Give nstab_lock mutex a priority. Also it's
Index: io/fileio/current//src/socket.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/fileio/current/src/socket.cxx,v
retrieving revision 1.6
diff -u -r1.6 socket.cxx
--- io/fileio/current//src/socket.cxx 11 Apr 2003 02:06:11 -0000 1.6
+++ io/fileio/current//src/socket.cxx 11 Jul 2003 09:29:53 -0000
@@ -148,7 +148,7 @@
{
SOCKET_ENTRY();
- int err = 0;
+ int err = EINVAL;
int fd;
cyg_file *file;