[CRIU] [PATCH] scripts: Exit early if no scripts passed

Cyrill Gorcunov gorcunov at openvz.org
Thu Nov 13 11:24:44 PST 2014


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 action-scripts.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/action-scripts.c b/action-scripts.c
index 97146443235e..1c9af0c5f4cd 100644
--- a/action-scripts.c
+++ b/action-scripts.c
@@ -30,6 +30,9 @@ int run_scripts(enum script_actions act)
 
 	pr_debug("Running %s scripts\n", action);
 
+	if (unlikely(list_empty(&opts.scripts)))
+		return 0;
+
 	if (setenv("CRTOOLS_SCRIPT_ACTION", action, 1)) {
 		pr_perror("Can't set CRTOOLS_SCRIPT_ACTION=%s", action);
 		return -1;
-- 
1.9.3



More information about the CRIU mailing list