From: Stéphane Graber Date: Thu, 27 Feb 2014 22:32:39 +0000 (-0500) Subject: start: Fix print_top_failing_dir for /var/lib/lxc X-Git-Tag: lxc-1.1.0.alpha1~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99b71824347e3681edec0b5af46dd91e849eae94;p=thirdparty%2Flxc.git start: Fix print_top_failing_dir for /var/lib/lxc 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 --- 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; }