1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-04 17:15:50 +00:00

Annotate uses of fgetsock() with indications that they should rely

on their existing file descriptor references to sockets, rather than
use fgetsock() to retrieve a direct socket reference.

MFC after:	3 months
This commit is contained in:
Robert Watson 2006-04-01 15:25:01 +00:00
parent ac45e92ff2
commit f7f45ac8e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157369
2 changed files with 12 additions and 0 deletions

View File

@ -662,6 +662,10 @@ linux_connect(struct thread *td, struct linux_connect_args *args)
* Linux doesn't return EISCONN the first time it occurs,
* when on a non-blocking socket. Instead it returns the
* error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD.
*
* XXXRW: Instead of using fgetsock(), check that it is a
* socket and use the file descriptor reference instead of
* creating a new one.
*/
NET_LOCK_GIANT();
error = fgetsock(td, linux_args.s, &so, &fflag);

View File

@ -167,6 +167,10 @@ svr4_sendit(td, s, mp, flags)
struct uio *ktruio = NULL;
#endif
/*
* XXXRW: Instead of using fgetsock(), just rely on the file
* descriptor reference.
*/
if ((error = fgetsock(td, s, &so, NULL)) != 0)
return (error);
@ -263,6 +267,10 @@ svr4_recvit(td, s, mp, namelenp)
struct uio *ktruio = NULL;
#endif
/*
* XXXRW: Instead of using fgetsock(), just rely on the file
* descriptor reference.
*/
if ((error = fgetsock(td, s, &so, NULL)) != 0)
return (error);