projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shutdown; clear suid; get/set hostname; nbio in state not options fixes
[unix-history]
/
usr
/
src
/
sys
/
kern
/
uipc_syscalls.c
diff --git
a/usr/src/sys/kern/uipc_syscalls.c
b/usr/src/sys/kern/uipc_syscalls.c
index
b0473ef
..
13cae1a
100644
(file)
--- a/
usr/src/sys/kern/uipc_syscalls.c
+++ b/
usr/src/sys/kern/uipc_syscalls.c
@@
-1,4
+1,4
@@
-/* uipc_syscalls.c 4.1
1 81/12/09
*/
+/* uipc_syscalls.c 4.1
5 82/03/15
*/
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
@@
-179,17
+179,26
@@
COUNT(SACCEPT);
}
s = splnet();
so = fp->f_socket;
}
s = splnet();
so = fp->f_socket;
- if ((so->so_
options & SO
_NBIO) &&
+ if ((so->so_
state & SS
_NBIO) &&
(so->so_state & SS_CONNAWAITING) == 0) {
u.u_error = EWOULDBLOCK;
splx(s);
return;
}
(so->so_state & SS_CONNAWAITING) == 0) {
u.u_error = EWOULDBLOCK;
splx(s);
return;
}
+ while ((so->so_state & SS_CONNAWAITING) == 0 && so->so_error == 0)
+ sleep((caddr_t)&so->so_timeo, PZERO+1);
+ if (so->so_error) {
+ u.u_error = so->so_error;
+ splx(s);
+ return;
+ }
u.u_error = soaccept(so, &sa);
if (u.u_error) {
splx(s);
return;
}
u.u_error = soaccept(so, &sa);
if (u.u_error) {
splx(s);
return;
}
+ if (uap->asa)
+ (void) copyout((caddr_t)&sa, (caddr_t)uap->asa, sizeof (sa));
/* deal with new file descriptor case */
/* u.u_r.r_val1 = ... */
splx(s);
/* deal with new file descriptor case */
/* u.u_r.r_val1 = ... */
splx(s);
@@
-227,7
+236,7
@@
COUNT(SCONNECT);
if (u.u_error)
return;
s = splnet();
if (u.u_error)
return;
s = splnet();
- if ((so->so_
options & SO
_NBIO) &&
+ if ((so->so_
state & SS
_NBIO) &&
(so->so_state & SS_ISCONNECTING)) {
u.u_error = EINPROGRESS;
splx(s);
(so->so_state & SS_ISCONNECTING)) {
u.u_error = EINPROGRESS;
splx(s);
@@
-273,7
+282,7
@@
COUNT(SDISCONNECT);
if (u.u_error)
return;
s = splnet();
if (u.u_error)
return;
s = splnet();
- if ((so->so_
options&SO
_NBIO) && (so->so_state&SS_ISDISCONNECTING)) {
+ if ((so->so_
state&SS
_NBIO) && (so->so_state&SS_ISDISCONNECTING)) {
u.u_error = EINPROGRESS;
splx(s);
return;
u.u_error = EINPROGRESS;
splx(s);
return;