Fix checking vps_is_mounted() return value
vps_is_mounted() does not return boolean value, as it can return -1 in
case of an error. Therefore, we should not treat it as such.
Document vps_is_mounted() return values, and replace all places
using this function as follows:
if (vps_is_mounted()) -> if (vps_is_mounted() == 1)
if (!vps_is_mounted()) -> if (vps_is_mounted() == 0)
We still don't do any error processing, but it is already way better
than to assume that CT is mounted while in fact we have an error.
Should also fix https://bugzilla.openvz.org/2534
Reported-by: Konstantin Pavlov <thresh@altlinux.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
9 files changed