From 99b71824347e3681edec0b5af46dd91e849eae94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 27 Feb 2014 17:32:39 -0500 Subject: [PATCH] start: Fix print_top_failing_dir for /var/lib/lxc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the case where /var/lib/lxc itself was not accessible, print_top_failing_dir would fail to print the error message. This fixes it and also change the initial access check for X_OK instead of R_OK (to match what we actually need and print_top_failing_dir's own check). Signed-off-by: Stéphane Graber Acked-by: Serge Hallyn --- src/lxc/start.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index f44be963c..fe3d09335 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -94,8 +94,6 @@ static void print_top_failing_dir(const char *path) while (p < e) { while (p < e && *p == '/') p++; while (p < e && *p != '/') p++; - if (p >= e) - return; saved = *p; *p = '\0'; if (access(copy, X_OK)) { @@ -666,7 +664,7 @@ static int do_start(void *data) } } - if (access(handler->lxcpath, R_OK)) { + if (access(handler->lxcpath, X_OK)) { print_top_failing_dir(handler->lxcpath); goto out_warn_father; }