about summary refs log tree commit diff
path: root/src/libs6/ftrig1_free.c
blob: 61c0d1d9994de645f8a71d4f1d7ed7f422b9d2b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ISC license. */

#include <skalibs/posixplz.h>
#include <skalibs/stralloc.h>
#include <skalibs/djbunix.h>
#include "ftrig1.h"

void ftrig1_free (ftrig1_t *p)
{
  if (p->name.s)
  {
    unlink_void(p->name.s) ;
    stralloc_free(&p->name) ;
  }
  if (p->fd >= 0)
  {
    fd_close(p->fd) ;
    p->fd = -1 ;
  }
  if (p->fdw >= 0)
  {
    fd_close(p->fdw) ;
    p->fdw = -1 ;
  }
}