blob: 3922721f37ae58fe72d2139661016d4fbc0d5c67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* ISC license. */
#include <skalibs/buffer.h>
#include <skalibs/djbunix.h>
#include <nsss/nsss-switch.h>
static inline void nsss_switch_disconnect (nsss_switch_t *a)
{
fd_close(buffer_fd(&a->b)) ;
a->b.fd = -1 ;
}
void nsss_switch_end (nsss_switch_t *a, unsigned int what)
{
a->held &= ~(1U << what) ;
if (!a->held) nsss_switch_disconnect(a) ;
}
|