2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

cgroup: print errors for umount and rmdir

CID 155804 (#1 of 1): Unchecked return value (CHECKED_RETURN)
2. check_return: Calling umount2 without checking return value (as is done elsewhere 8 out of 9 times).
This commit is contained in:
Andrei Vagin 2018-02-08 21:18:22 +03:00
parent 5ab6836b0c
commit 04c1634dfc

View File

@ -1163,8 +1163,10 @@ void fini_cgroup(void)
return; return;
close_service_fd(CGROUP_YARD); close_service_fd(CGROUP_YARD);
umount2(cg_yard, MNT_DETACH); if (umount2(cg_yard, MNT_DETACH))
rmdir(cg_yard); pr_perror("Unable to umount %s", cg_yard);
if (rmdir(cg_yard))
pr_perror("Unable to remove %s", cg_yard);
xfree(cg_yard); xfree(cg_yard);
cg_yard = NULL; cg_yard = NULL;
} }