diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-10-31 16:13:05 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-30 20:43:25 +0100 |
commit | 40fd52f28d464d357376d8c641f5a80fdbda59a3 (patch) | |
tree | 6b4458d1421041bf88fd5158f4da6d6f6288289d | |
parent | a66fee2e970bd3e6ac35db2dd6e377c83093b10e (diff) | |
download | systemd-40fd52f28d464d357376d8c641f5a80fdbda59a3.tar.gz |
util-lib: rename path_check_fstype to path_is_fs_type
-rw-r--r-- | src/basic/stat-util.c | 2 | ||||
-rw-r--r-- | src/basic/stat-util.h | 2 | ||||
-rw-r--r-- | src/nspawn/nspawn-mount.c | 2 | ||||
-rw-r--r-- | src/test/test-stat-util.c | 16 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 483c3363af..c6b8507e9d 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -202,7 +202,7 @@ int fd_is_fs_type(int fd, statfs_f_type_t magic_value) { return is_fs_type(&s, magic_value); } -int path_check_fstype(const char *path, statfs_f_type_t magic_value) { +int path_is_fs_type(const char *path, statfs_f_type_t magic_value) { _cleanup_close_ int fd = -1; fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH); diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h index 931f9eb7c4..8b8d128121 100644 --- a/src/basic/stat-util.h +++ b/src/basic/stat-util.h @@ -58,7 +58,7 @@ typedef typeof(((struct statfs*)NULL)->f_type) statfs_f_type_t; bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) _pure_; int fd_is_fs_type(int fd, statfs_f_type_t magic_value); -int path_check_fstype(const char *path, statfs_f_type_t magic_value); +int path_is_fs_type(const char *path, statfs_f_type_t magic_value); bool is_temporary_fs(const struct statfs *s) _pure_; int fd_is_temporary_fs(int fd); diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index e6a92411ad..920e114718 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -405,7 +405,7 @@ int mount_sysfs(const char *dest, MountSettingsMask mount_settings) { unsigned long extra_flags = 0; top = prefix_roota(dest, "/sys"); - r = path_check_fstype(top, SYSFS_MAGIC); + r = path_is_fs_type(top, SYSFS_MAGIC); if (r < 0) return log_error_errno(r, "Failed to determine filesystem type of %s: %m", top); /* /sys might already be mounted as sysfs by the outer child in the diff --git a/src/test/test-stat-util.c b/src/test/test-stat-util.c index b58f31dd53..c606425d2d 100644 --- a/src/test/test-stat-util.c +++ b/src/test/test-stat-util.c @@ -72,16 +72,16 @@ static void test_path_is_os_tree(void) { assert_se(path_is_os_tree("/idontexist") == -ENOENT); } -static void test_path_check_fstype(void) { +static void test_path_is_fs_type(void) { /* run might not be a mount point in build chroots */ if (path_is_mount_point("/run", NULL, AT_SYMLINK_FOLLOW) > 0) { - assert_se(path_check_fstype("/run", TMPFS_MAGIC) > 0); - assert_se(path_check_fstype("/run", BTRFS_SUPER_MAGIC) == 0); + assert_se(path_is_fs_type("/run", TMPFS_MAGIC) > 0); + assert_se(path_is_fs_type("/run", BTRFS_SUPER_MAGIC) == 0); } - assert_se(path_check_fstype("/proc", PROC_SUPER_MAGIC) > 0); - assert_se(path_check_fstype("/proc", BTRFS_SUPER_MAGIC) == 0); - assert_se(path_check_fstype("/proc", BTRFS_SUPER_MAGIC) == 0); - assert_se(path_check_fstype("/i-dont-exist", BTRFS_SUPER_MAGIC) == -ENOENT); + assert_se(path_is_fs_type("/proc", PROC_SUPER_MAGIC) > 0); + assert_se(path_is_fs_type("/proc", BTRFS_SUPER_MAGIC) == 0); + assert_se(path_is_fs_type("/proc", BTRFS_SUPER_MAGIC) == 0); + assert_se(path_is_fs_type("/i-dont-exist", BTRFS_SUPER_MAGIC) == -ENOENT); } static void test_path_is_temporary_fs(void) { @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) { test_files_same(); test_is_symlink(); test_path_is_os_tree(); - test_path_check_fstype(); + test_path_is_fs_type(); test_path_is_temporary_fs(); return 0; |