summaryrefslogtreecommitdiff
path: root/src/libs6/ftrig1_free.c
blob: 091dc87821cb34c0b069a5409b25dc7f318d3b62 (plain)
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 <unistd.h>
#include <skalibs/stralloc.h>
#include <skalibs/djbunix.h>
#include "ftrig1.h"

void ftrig1_free (ftrig1_t *p)
{
  if (p->name.s)
  {
    unlink(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 ;
  }
}