MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngt_shutdown

Function ngt_shutdown

freebsd/netgraph/ng_tty.c:224–242  ·  view source on GitHub ↗

* Remove this node. The does the netgraph portion of the shutdown. */

Source from the content-addressed store, hash-verified

222 * Remove this node. The does the netgraph portion of the shutdown.
223 */
224static int
225ngt_shutdown(node_p node)
226{
227 const sc_p sc = NG_NODE_PRIVATE(node);
228 struct tty *tp;
229
230 tp = sc->tp;
231 if (tp != NULL) {
232 tty_lock(tp);
233 ttyhook_unregister(tp);
234 }
235 /* Free resources */
236 IF_DRAIN(&sc->outq);
237 mtx_destroy(&(sc)->outq.ifq_mtx);
238 NG_NODE_UNREF(sc->node);
239 free(sc, M_NETGRAPH);
240
241 return (0);
242}
243
244/*
245 * Receive control message

Callers

nothing calls this directly

Calls 2

ttyhook_unregisterFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected