diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-07-21 11:17:53 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-07-21 11:17:53 +0000 |
commit | 122f9363682e5de8ce4056c4c05c1eaf8935cf19 (patch) | |
tree | 8119a97386da98cddb70d29c89715302fd6df701 | |
parent | 6c7a5b92bdfe68e847d371cc41f6655df3ef1ba5 (diff) | |
download | skalibs-122f9363682e5de8ce4056c4c05c1eaf8935cf19.tar.xz |
Save errno when freeing a cdb
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | src/libstddjb/cdb_free.c | 9 |
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 ; } |