From: Serge Hallyn Date: Mon, 14 Jul 2014 18:22:53 +0000 (-0500) Subject: rootfs_is_blockdev: don't run if no rootfs is specified X-Git-Tag: lxc-1.1.0.alpha2~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acf9f89e61caadbc614107773a2fa14d8f3458ea;p=thirdparty%2Flxc.git rootfs_is_blockdev: don't run if no rootfs is specified Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 9d29e3e1a..fad284596 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -3123,6 +3123,10 @@ bool rootfs_is_blockdev(struct lxc_conf *conf) struct stat st; int ret; + if (!conf->rootfs.path || strcmp(conf->rootfs.path, "/") == 0 || + strlen(conf->rootfs.path) == 0) + return false; + ret = stat(conf->rootfs.path, &st); if (ret == 0 && S_ISBLK(st.st_mode)) return true;