/* ISC license. */

#include <sys/mman.h>
#include <skalibs/cdb.h>

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

/* 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 ;
}

Save errno when freeing a cdb
 Save errno when freeing a cdb

Signed-off-by: Laurent Bercot <3aa9adbbb49a4d5ab9c798d5e366f54570870800@appnovation.com>
