Patch from Eric Norum to correct bug induced by select() patch.

This commit is contained in:
Joel Sherrill
1999-02-05 00:29:23 +00:00
parent 2f87c84349
commit ecec2ba7bd
8 changed files with 44 additions and 20 deletions

View File

@@ -188,5 +188,8 @@ int rtems_bsdnet_makeFdForSocket (void *);
#define NETISR_IP_EVENT (1 << NETISR_IP)
#define NETISR_ARP_EVENT (1 << NETISR_ARP)
#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
# error "Network event conflict"
#endif
#endif /* _RTEMS_BSDNET_INTERNAL_H_ */

View File

@@ -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);
}
}

View File

@@ -188,5 +188,8 @@ int rtems_bsdnet_makeFdForSocket (void *);
#define NETISR_IP_EVENT (1 << NETISR_IP)
#define NETISR_ARP_EVENT (1 << NETISR_ARP)
#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
# error "Network event conflict"
#endif
#endif /* _RTEMS_BSDNET_INTERNAL_H_ */

View File

@@ -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);
}
}

View File

@@ -188,5 +188,8 @@ int rtems_bsdnet_makeFdForSocket (void *);
#define NETISR_IP_EVENT (1 << NETISR_IP)
#define NETISR_ARP_EVENT (1 << NETISR_ARP)
#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
# error "Network event conflict"
#endif
#endif /* _RTEMS_BSDNET_INTERNAL_H_ */

View File

@@ -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);
}
}

View File

@@ -188,5 +188,8 @@ int rtems_bsdnet_makeFdForSocket (void *);
#define NETISR_IP_EVENT (1 << NETISR_IP)
#define NETISR_ARP_EVENT (1 << NETISR_ARP)
#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT)
#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
# error "Network event conflict"
#endif
#endif /* _RTEMS_BSDNET_INTERNAL_H_ */

View File

@@ -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);
}
}