Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iscsi/icl_soft.c
Show First 20 Lines • Show All 1,391 Lines • ▼ Show 20 Lines | if (fd == 0) { | ||||
return (0); | return (0); | ||||
} | } | ||||
#endif | #endif | ||||
/* | /* | ||||
* Steal the socket from userland. | * Steal the socket from userland. | ||||
*/ | */ | ||||
error = fget(curthread, fd, | error = fget(curthread, fd, | ||||
cap_rights_init(&rights, CAP_SOCK_CLIENT), &fp); | cap_rights_init_one(&rights, CAP_SOCK_CLIENT), &fp); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if (fp->f_type != DTYPE_SOCKET) { | if (fp->f_type != DTYPE_SOCKET) { | ||||
fdrop(fp, curthread); | fdrop(fp, curthread); | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
so = fp->f_data; | so = fp->f_data; | ||||
if (so->so_type != SOCK_STREAM) { | if (so->so_type != SOCK_STREAM) { | ||||
▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines |