From 91b1c8e69e8b047c62cd301ebf6f4b8627941c08 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 7 Dec 1998 17:42:52 +0000 Subject: Patch from Ian Lance Taylor : RTEMS permits using the SO_SNDTIMEO and SO_RCVTIMEO socket options to set a timeout for most socket I/O operations. However, in RTEMS 4.0.0, those options do not affect connect or accept. I don't know of any way to put a timeout on those calls in RTEMS 4.0.0; can anybody point to one. Since it is frequently useful to have a timeout on accept, and sometimes useful to have a timeout on connect shorter than the BSD system default of 75 seconds, the following patch causes SO_RCVTIMEO to affect connect and accept. --- c/src/libnetworking/rtems/rtems_syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c/src/libnetworking/rtems/rtems_syscall.c') diff --git a/c/src/libnetworking/rtems/rtems_syscall.c b/c/src/libnetworking/rtems/rtems_syscall.c index 782a2f907b..93ecd47c6f 100644 --- a/c/src/libnetworking/rtems/rtems_syscall.c +++ b/c/src/libnetworking/rtems/rtems_syscall.c @@ -211,7 +211,7 @@ connect (int s, struct sockaddr *name, int namelen) return -1; } while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { - soconnsleep (so); + so->so_error = soconnsleep (so); } if (error == 0) { error = so->so_error; @@ -271,7 +271,7 @@ accept (int s, struct sockaddr *name, int *namelen) head->so_error = ECONNABORTED; break; } - soconnsleep (head); + head->so_error = soconnsleep (head); } if (head->so_error) { errno = head->so_error; -- cgit v1.2.3