| 1960 | } |
| 1961 | |
| 1962 | static void |
| 1963 | unp_drop(struct unpcb *unp) |
| 1964 | { |
| 1965 | struct socket *so = unp->unp_socket; |
| 1966 | struct unpcb *unp2; |
| 1967 | |
| 1968 | /* |
| 1969 | * Regardless of whether the socket's peer dropped the connection |
| 1970 | * with this socket by aborting or disconnecting, POSIX requires |
| 1971 | * that ECONNRESET is returned. |
| 1972 | */ |
| 1973 | |
| 1974 | UNP_PCB_LOCK(unp); |
| 1975 | if (so) |
| 1976 | so->so_error = ECONNRESET; |
| 1977 | if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) { |
| 1978 | /* Last reference dropped in unp_disconnect(). */ |
| 1979 | unp_pcb_rele_notlast(unp); |
| 1980 | unp_disconnect(unp, unp2); |
| 1981 | } else if (!unp_pcb_rele(unp)) { |
| 1982 | UNP_PCB_UNLOCK(unp); |
| 1983 | } |
| 1984 | } |
| 1985 | |
| 1986 | static void |
| 1987 | unp_freerights(struct filedescent **fdep, int fdcount) |
no test coverage detected