summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstddjb/cdb_free.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstddjb/cdb_free.c b/src/libstddjb/cdb_free.c
index 04ebf3e..d4250ec 100644
--- a/src/libstddjb/cdb_free.c
+++ b/src/libstddjb/cdb_free.c
@@ -1,10 +1,17 @@
/* ISC license. */
#include <sys/mman.h>
+#include <errno.h>
+
#include <skalibs/cdb.h>
extern void cdb_free (struct cdb *c)
{
- if (c->map) munmap(c->map, c->size) ;
+ if (c->map)
+ {
+ int e = errno ;
+ munmap(c->map, c->size) ;
+ errno = e ;
+ }
*c = cdb_zero ;
}