[Devel] [PATCH] run_action(): refer variable only once
Igor Podlesny
openvz at poige.ru
Tue May 7 22:25:03 PDT 2013
---
src/vzctl-actions.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/vzctl-actions.c b/src/vzctl-actions.c
index e0cd261..055c6f0 100644
--- a/src/vzctl-actions.c
+++ b/src/vzctl-actions.c
@@ -1490,13 +1490,14 @@ int run_action(envid_t veid, act_t action, vps_param *g_p, vps_param *vps_p,
g_p->res.dq.enable = NO;
}
- if (action != ACTION_EXEC &&
- action != ACTION_EXEC2 &&
- action != ACTION_EXEC3 &&
- action != ACTION_ENTER &&
- action != ACTION_CONSOLE &&
- action != ACTION_STATUS)
- {
+ switch (action) {
+ case ACTION_EXEC:
+ case ACTION_EXEC2:
+ case ACTION_EXEC3:
+ case ACTION_ENTER:
+ case ACTION_CONSOLE:
+ case ACTION_STATUS: break;
+ default:
if (skiplock != YES) {
lock_id = vps_lock(veid, g_p->opt.lockdir, "");
if (lock_id > 0) {
--
1.7.9.5
More information about the Devel
mailing list