2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00
criu/test/umount2.c
Andrei Vagin 2dc2d8c56f zdtm: add a program to umount a test root
This program doesn't parse /etc/fstab or /etc/mtab,
it just calls the umount2 syscall.

It is another attempt to fix the error:
subprocess.CalledProcessError: Command '['mount', '--make-private', '/tmp/criu-root-C7MZS9']' returned non-zero exit status 1
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-C7MZS9'

Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-09-26 15:42:40 +03:00

17 lines
259 B
C

#include <stdio.h>
#include <sys/mount.h>
int main(int argc, char *argv[])
{
if (argc < 2) {
fprintf(stderr, "umount PATH\n");
return 1;
}
if (umount2(argv[1], MNT_DETACH)) {
fprintf(stderr, "umount %s: %m\n", argv[1]);
return 1;
}
return 0;
}