summaryrefslogtreecommitdiff
path: root/src/libstddjb/cdb_free.c
blob: d4250ec5466f9728f8b99953ec158cba66378f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* ISC license. */

#include <sys/mman.h>
#include <errno.h>

#include <skalibs/cdb.h>

extern void cdb_free (struct cdb *c)
{
  if (c->map)
  {
    int e = errno ;
    munmap(c->map, c->size) ;
    errno = e ;
  }
  *c = cdb_zero ;
}