mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-26 02:20:51 +01:00
Fix missing holdsock()->fgetsock()
Submitted by: Hisashi Hiramoto <hiramoto@phys.chs.nihon-u.ac.jp>
This commit is contained in:
parent
3cf64d0fbb
commit
39c95b8377
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86504
@ -416,7 +416,7 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
|
||||
int namelen;
|
||||
} */ bsd_args;
|
||||
struct socket *so;
|
||||
struct file *fp;
|
||||
u_int fflag;
|
||||
int error;
|
||||
|
||||
#ifdef __alpha__
|
||||
@ -438,17 +438,15 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
|
||||
* when on a non-blocking socket. Instead it returns the
|
||||
* error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD.
|
||||
*/
|
||||
error = holdsock(td->td_proc->p_fd, linux_args.s, &fp);
|
||||
if (error)
|
||||
return (error);
|
||||
if ((error = fgetsock(td, linux_args.s, &so, &fflag)) != 0)
|
||||
return(error);
|
||||
error = EISCONN;
|
||||
if (fp->f_flag & FNONBLOCK) {
|
||||
so = (struct socket *)fp->f_data;
|
||||
if (fflag & FNONBLOCK) {
|
||||
if (so->so_emuldata == 0)
|
||||
error = so->so_error;
|
||||
so->so_emuldata = (void *)1;
|
||||
}
|
||||
fdrop(fp, td);
|
||||
fputsock(so);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user