| 2100 | } |
| 2101 | |
| 2102 | int |
| 2103 | finstall(struct thread *td, struct file *fp, int *fd, int flags, |
| 2104 | struct filecaps *fcaps) |
| 2105 | { |
| 2106 | int error; |
| 2107 | |
| 2108 | MPASS(fd != NULL); |
| 2109 | |
| 2110 | if (!fhold(fp)) |
| 2111 | return (EBADF); |
| 2112 | error = finstall_refed(td, fp, fd, flags, fcaps); |
| 2113 | if (__predict_false(error != 0)) { |
| 2114 | fdrop(fp, td); |
| 2115 | } |
| 2116 | return (error); |
| 2117 | } |
| 2118 | |
| 2119 | /* |
| 2120 | * Build a new filedesc structure from another. |
no test coverage detected