diff options
Diffstat (limited to 'src/libs6rc/s6rc_db_free.c')
-rw-r--r-- | src/libs6rc/s6rc_db_free.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libs6rc/s6rc_db_free.c b/src/libs6rc/s6rc_db_free.c new file mode 100644 index 0000000..7e7ed54 --- /dev/null +++ b/src/libs6rc/s6rc_db_free.c @@ -0,0 +1,17 @@ +/* ISC license. */ + +#include <sys/mman.h> +#include <errno.h> + +#include <skalibs/alloc.h> + +#include <s6-rc/db.h> + +void s6rc_db_free (s6rc_db_t *db) +{ + int e = errno ; + alloc_free(db->argvs) ; + munmap(db->map, db->size) ; + db->map = 0 ; + errno = e ; +} |