Unmount cgroup FS after use

This commit is contained in:
Jagger 2016-06-19 14:25:41 +02:00
parent edab0fe9e4
commit 0498920fce

View File

@ -25,6 +25,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@ -64,5 +65,11 @@ bool cgroupInitNs(struct nsjconf_t *nsjconf)
return false;
}
LOG_D("Unmounting '%s'", nsjconf->cgroup_mem_mount);
if (umount2(nsjconf->cgroup_mem_mount, MNT_DETACH) == -1) {
PLOG_E("Could not umount2('%s', MNT_DETACH)", nsjconf->cgroup_mem_mount);
return false;
}
return true;
}