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
correct no-such-process error
[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
0e2c19c
..
727b9dd
100644
(file)
--- a/
usr/src/sys/kern/uipc_syscalls.c
+++ b/
usr/src/sys/kern/uipc_syscalls.c
@@
-3,7
+3,7
@@
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)uipc_syscalls.c 6.1
0
(Berkeley) %G%
+ * @(#)uipc_syscalls.c 6.1
6
(Berkeley) %G%
*/
#include "param.h"
*/
#include "param.h"
@@
-188,6
+188,11
@@
connect()
if (fp == 0)
return;
so = (struct socket *)fp->f_data;
if (fp == 0)
return;
so = (struct socket *)fp->f_data;
+ if ((so->so_state & SS_NBIO) &&
+ (so->so_state & SS_ISCONNECTING)) {
+ u.u_error = EINPROGRESS;
+ return;
+ }
u.u_error = sockargs(&nam, uap->name, uap->namelen, MT_SONAME);
if (u.u_error)
return;
u.u_error = sockargs(&nam, uap->name, uap->namelen, MT_SONAME);
if (u.u_error)
return;
@@
-195,11
+200,6
@@
connect()
if (u.u_error)
goto bad;
s = splnet();
if (u.u_error)
goto bad;
s = splnet();
- if ((so->so_state & SS_NBIO) &&
- (so->so_state & SS_ISCONNECTING)) {
- u.u_error = EINPROGRESS;
- goto bad2;
- }
if (setjmp(&u.u_qsave)) {
if (u.u_error == 0)
u.u_error = EINTR;
if (setjmp(&u.u_qsave)) {
if (u.u_error == 0)
u.u_error = EINTR;
@@
-212,6
+212,7
@@
connect()
bad2:
splx(s);
bad:
bad2:
splx(s);
bad:
+ so->so_state &= ~SS_ISCONNECTING;
m_freem(nam);
}
m_freem(nam);
}
@@
-274,11
+275,9
@@
free3:
fp1->f_count = 0;
u.u_ofile[sv[0]] = 0;
free2:
fp1->f_count = 0;
u.u_ofile[sv[0]] = 0;
free2:
- so2->so_state |= SS_NOFDREF;
- sofree(so2);
+ (void)soclose(so2);
free:
free:
- so1->so_state |= SS_NOFDREF;
- sofree(so1);
+ (void)soclose(so1);
}
sendto()
}
sendto()
@@
-350,11
+349,6
@@
sendmsg()
if (u.u_error)
return;
msg.msg_iov = aiov;
if (u.u_error)
return;
msg.msg_iov = aiov;
-#ifdef notdef
-printf("sendmsg name %x namelen %d iov %x iovlen %d accrights %x &len %d\n",
-msg.msg_name, msg.msg_namelen, msg.msg_iov, msg.msg_iovlen,
-msg.msg_accrights, msg.msg_accrightslen);
-#endif
sendit(uap->s, &msg, uap->flags);
}
sendit(uap->s, &msg, uap->flags);
}
@@
-379,7
+373,7
@@
sendit(s, mp, flags)
auio.uio_offset = 0; /* XXX */
auio.uio_resid = 0;
iov = mp->msg_iov;
auio.uio_offset = 0; /* XXX */
auio.uio_resid = 0;
iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++) {
+ for (i = 0; i < mp->msg_iovlen; i++
, iov++
) {
if (iov->iov_len < 0) {
u.u_error = EINVAL;
return;
if (iov->iov_len < 0) {
u.u_error = EINVAL;
return;
@@
-391,7
+385,6
@@
sendit(s, mp, flags)
return;
}
auio.uio_resid += iov->iov_len;
return;
}
auio.uio_resid += iov->iov_len;
- iov++;
}
if (mp->msg_name) {
u.u_error =
}
if (mp->msg_name) {
u.u_error =
@@
-526,7
+519,7
@@
recvit(s, mp, flags, namelenp, rightslenp)
auio.uio_offset = 0; /* XXX */
auio.uio_resid = 0;
iov = mp->msg_iov;
auio.uio_offset = 0; /* XXX */
auio.uio_resid = 0;
iov = mp->msg_iov;
- for (i = 0; i < mp->msg_iovlen; i++) {
+ for (i = 0; i < mp->msg_iovlen; i++
, iov++
) {
if (iov->iov_len < 0) {
u.u_error = EINVAL;
return;
if (iov->iov_len < 0) {
u.u_error = EINVAL;
return;
@@
-538,7
+531,6
@@
recvit(s, mp, flags, namelenp, rightslenp)
return;
}
auio.uio_resid += iov->iov_len;
return;
}
auio.uio_resid += iov->iov_len;
- iov++;
}
len = auio.uio_resid;
u.u_error =
}
len = auio.uio_resid;
u.u_error =
@@
-696,7
+688,7
@@
pipe()
wf->f_data = (caddr_t)wso;
u.u_r.r_val2 = u.u_r.r_val1;
u.u_r.r_val1 = r;
wf->f_data = (caddr_t)wso;
u.u_r.r_val2 = u.u_r.r_val1;
u.u_r.r_val1 = r;
- if (u.u_error = unp_connect2(wso,
(struct mbuf *)0,
rso))
+ if (u.u_error = unp_connect2(wso, rso))
goto free4;
wso->so_state |= SS_CANTRCVMORE;
rso->so_state |= SS_CANTSENDMORE;
goto free4;
wso->so_state |= SS_CANTRCVMORE;
rso->so_state |= SS_CANTSENDMORE;
@@
-708,11
+700,9
@@
free3:
rf->f_count = 0;
u.u_ofile[r] = 0;
free2:
rf->f_count = 0;
u.u_ofile[r] = 0;
free2:
- wso->so_state |= SS_NOFDREF;
- sofree(wso);
+ (void)soclose(wso);
free:
free:
- rso->so_state |= SS_NOFDREF;
- sofree(rso);
+ (void)soclose(rso);
}
/*
}
/*