Remove fflag argument from getsock_cap
Interested callers can obtain in other own easily enough and there is no reason to branch on it.
This commit is contained in:
parent
3212ad15ab
commit
3be2225fc8
@ -90,7 +90,7 @@ static int sockargs(struct mbuf **, char *, socklen_t, int);
|
||||
*/
|
||||
int
|
||||
getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
|
||||
struct file **fpp, u_int *fflagp, struct filecaps *havecapsp)
|
||||
struct file **fpp, struct filecaps *havecapsp)
|
||||
{
|
||||
struct file *fp;
|
||||
int error;
|
||||
@ -104,8 +104,6 @@ getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
|
||||
filecaps_free(havecapsp);
|
||||
return (ENOTSOCK);
|
||||
}
|
||||
if (fflagp != NULL)
|
||||
*fflagp = fp->f_flag;
|
||||
*fpp = fp;
|
||||
return (0);
|
||||
}
|
||||
@ -347,9 +345,10 @@ kern_accept4(struct thread *td, int s, struct sockaddr **name,
|
||||
|
||||
AUDIT_ARG_FD(s);
|
||||
error = getsock_cap(td, s, &cap_accept_rights,
|
||||
&headfp, &fflag, &fcaps);
|
||||
&headfp, &fcaps);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
fflag = atomic_load_int(&fp->f_flag);
|
||||
head = headfp->f_data;
|
||||
if (!SOLISTENING(head)) {
|
||||
error = EINVAL;
|
||||
|
@ -449,7 +449,7 @@ struct uio;
|
||||
int getsockaddr(struct sockaddr **namp, const struct sockaddr *uaddr,
|
||||
size_t len);
|
||||
int getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
|
||||
struct file **fpp, u_int *fflagp, struct filecaps *havecaps);
|
||||
struct file **fpp, struct filecaps *havecaps);
|
||||
int getsock(struct thread *td, int fd, cap_rights_t *rightsp,
|
||||
struct file **fpp);
|
||||
void soabort(struct socket *so);
|
||||
|
Loading…
Reference in New Issue
Block a user