agent: fix wrong return value of set_sandbox_storage()

Function set_sandbox_storage() is designed to return true when the
reference count drops from 1 to 0. But current implementation always
return true no matter the reference count is, which may cause removing
an in use mountpoint.

Fixes: #88

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
This commit is contained in:
Liu Jiang 2019-12-02 15:52:47 +08:00
parent b1748323f0
commit 94311e4997

View File

@ -103,8 +103,9 @@ impl Sandbox {
*count -= 1;
if *count < 1 {
self.storages.remove(path);
return true;
}
return true;
false
}
}
}