From ecec2ba7bd4f5b4786c30f7ed40db5faa124352d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 5 Feb 1999 00:29:23 +0000 Subject: Patch from Eric Norum to correct bug induced by select() patch. --- cpukit/libnetworking/rtems/rtems_glue.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cpukit/libnetworking/rtems/rtems_glue.c') diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c index 28fb179c22..5eb885e70e 100644 --- a/cpukit/libnetworking/rtems/rtems_glue.c +++ b/cpukit/libnetworking/rtems/rtems_glue.c @@ -295,6 +295,11 @@ sbwait(sb) rtems_task_ident (RTEMS_SELF, 0, &tid); sb->sb_sel.si_pid = tid; + /* + * Show that socket is waiting + */ + sb->sb_flags |= SB_WAIT; + /* * Release the network semaphore. */ @@ -329,11 +334,9 @@ sowakeup(so, sb) register struct socket *so; register struct sockbuf *sb; { - rtems_id tid; - - if ((tid = sb->sb_sel.si_pid) != 0) { - sb->sb_sel.si_pid = 0; - rtems_event_send (tid, SBWAIT_EVENT); + if (sb->sb_flags & SB_WAIT) { + sb->sb_flags &= ~SB_WAIT; + rtems_event_send (sb->sb_sel.si_pid, SBWAIT_EVENT); } } -- cgit v1.2.3