summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libnetworking/rtems/rtems_syscall.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-12-07 17:42:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-12-07 17:42:52 +0000
commit91b1c8e69e8b047c62cd301ebf6f4b8627941c08 (patch)
tree7e836dcb925324762fdd9825fbc22ec3cb46003a /c/src/lib/libnetworking/rtems/rtems_syscall.c
parentchanged version to 19981203 (diff)
downloadrtems-91b1c8e69e8b047c62cd301ebf6f4b8627941c08.tar.bz2
Patch from Ian Lance Taylor <ian@airs.com>:
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.
Diffstat (limited to 'c/src/lib/libnetworking/rtems/rtems_syscall.c')
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/src/lib/libnetworking/rtems/rtems_syscall.c b/c/src/lib/libnetworking/rtems/rtems_syscall.c
index 782a2f907b..93ecd47c6f 100644
--- a/c/src/lib/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/lib/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;