path-util: introduce empty_to_root() and use it many places

This commit is contained in:
Yu Watanabe
2018-05-11 01:47:33 +09:00
parent 54138a8de1
commit 945403e6ed
7 changed files with 12 additions and 13 deletions
+1 -1
View File
@@ -1502,7 +1502,7 @@ static int create_item(Item *i) {
if (IN_SET(i->type, CREATE_SUBVOLUME, CREATE_SUBVOLUME_INHERIT_QUOTA, CREATE_SUBVOLUME_NEW_QUOTA)) {
if (btrfs_is_subvol(isempty(arg_root) ? "/" : arg_root) <= 0)
if (btrfs_is_subvol(empty_to_root(arg_root)) <= 0)
/* Don't create a subvolume unless the
* root directory is one, too. We do