* API socket close on file pointer. We call soclose() to close the socket * (including initiating closing protocols). soclose() will sorele() the * file reference but the actual socket will not go away until the socket's * ref count hits 0. */
| 352 | * ref count hits 0. |
| 353 | */ |
| 354 | static int |
| 355 | soo_close(struct file *fp, struct thread *td) |
| 356 | { |
| 357 | int error = 0; |
| 358 | struct socket *so; |
| 359 | |
| 360 | so = fp->f_data; |
| 361 | fp->f_ops = &badfileops; |
| 362 | fp->f_data = NULL; |
| 363 | |
| 364 | if (so) |
| 365 | error = soclose(so); |
| 366 | return (error); |
| 367 | } |
| 368 | |
| 369 | #ifndef FSTACK |
| 370 | static int |