Changeset View
Changeset View
Standalone View
Standalone View
sys/rpc/svc_vc.c
| Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | #endif | ||||
| * socket created by kernel as well as socket shared with userland, | * socket created by kernel as well as socket shared with userland, | ||||
| * so we can't be sure about presense of SS_NBIO. We also shall not | * so we can't be sure about presense of SS_NBIO. We also shall not | ||||
| * toggle it on the socket, since that may surprise userland. So we | * toggle it on the socket, since that may surprise userland. So we | ||||
| * set SS_NBIO only temporarily. | * set SS_NBIO only temporarily. | ||||
| */ | */ | ||||
| SOLISTEN_LOCK(head); | SOLISTEN_LOCK(head); | ||||
| nbio = head->so_state & SS_NBIO; | nbio = head->so_state & SS_NBIO; | ||||
| head->so_state |= SS_NBIO; | head->so_state |= SS_NBIO; | ||||
| error = solisten_dequeue(head, &so, 0); | error = solisten_dequeue(head, &so, nbio ? SOCK_NONBLOCK : 0); | ||||
| head->so_state &= (nbio & ~SS_NBIO); | if (nbio == 0) { | ||||
| SOLISTEN_LOCK(head); | |||||
| head->so_state &= ~SS_NBIO; | |||||
glebius: Isn't this change going to clear SS_NBIO in the case it was originally set? | |||||
| SOLISTEN_UNLOCK(head); | |||||
| } | |||||
Done Inline ActionsThis line also doesn't make sense. It always sets so_state = 0. markj: This line also doesn't make sense. It always sets `so_state = 0`. | |||||
Not Done Inline ActionsYea, I suspect the original line was meant to Good catch! rmacklem: Yea, I suspect the original line was meant to
be head->so_state &= (nbio | ~SS_NBIO);.
(I… | |||||
| if (error) | if (error) | ||||
| goto done; | goto done; | ||||
| so->so_state |= nbio; | |||||
| *sop = so; | *sop = so; | ||||
| /* connection has been removed from the listen queue */ | /* connection has been removed from the listen queue */ | ||||
| KNOTE_UNLOCKED(&head->so_rdsel.si_note, 0); | KNOTE_UNLOCKED(&head->so_rdsel.si_note, 0); | ||||
| done: | done: | ||||
| return (error); | return (error); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 777 Lines • Show Last 20 Lines | |||||
Isn't this change going to clear SS_NBIO in the case it was originally set?