From e26d6ce517a49c246141ed20528614823c2f5799 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 29 May 2015 17:13:12 +0200 Subject: path-util: Change path_is_mount_point() symlink arg from bool to flags This makes path_is_mount_point() consistent with fd_is_mount_point() wrt. flags. --- src/test/test-path-util.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/test') diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 80782ff902..0045ae6824 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -316,17 +316,17 @@ static void test_path_is_mount_point(void) { char tmp_dir[] = "/tmp/test-path-is-mount-point-XXXXXX"; _cleanup_free_ char *file1 = NULL, *file2 = NULL, *link1 = NULL, *link2 = NULL; - assert_se(path_is_mount_point("/", true) > 0); - assert_se(path_is_mount_point("/", false) > 0); + assert_se(path_is_mount_point("/", AT_SYMLINK_FOLLOW) > 0); + assert_se(path_is_mount_point("/", 0) > 0); - assert_se(path_is_mount_point("/proc", true) > 0); - assert_se(path_is_mount_point("/proc", false) > 0); + assert_se(path_is_mount_point("/proc", AT_SYMLINK_FOLLOW) > 0); + assert_se(path_is_mount_point("/proc", 0) > 0); - assert_se(path_is_mount_point("/proc/1", true) == 0); - assert_se(path_is_mount_point("/proc/1", false) == 0); + assert_se(path_is_mount_point("/proc/1", AT_SYMLINK_FOLLOW) == 0); + assert_se(path_is_mount_point("/proc/1", 0) == 0); - assert_se(path_is_mount_point("/sys", true) > 0); - assert_se(path_is_mount_point("/sys", false) > 0); + assert_se(path_is_mount_point("/sys", AT_SYMLINK_FOLLOW) > 0); + assert_se(path_is_mount_point("/sys", 0) > 0); /* file mountpoints */ assert_se(mkdtemp(tmp_dir) != NULL); @@ -347,17 +347,17 @@ static void test_path_is_mount_point(void) { assert_se(link1); assert_se(symlink("file2", link2) == 0); - assert_se(path_is_mount_point(file1, true) == 0); - assert_se(path_is_mount_point(file1, false) == 0); - assert_se(path_is_mount_point(link1, true) == 0); - assert_se(path_is_mount_point(link1, false) == 0); + assert_se(path_is_mount_point(file1, AT_SYMLINK_FOLLOW) == 0); + assert_se(path_is_mount_point(file1, 0) == 0); + assert_se(path_is_mount_point(link1, AT_SYMLINK_FOLLOW) == 0); + assert_se(path_is_mount_point(link1, 0) == 0); /* this test will only work as root */ if (mount(file1, file2, NULL, MS_BIND, NULL) >= 0) { - rf = path_is_mount_point(file2, false); - rt = path_is_mount_point(file2, true); - rlf = path_is_mount_point(link2, false); - rlt = path_is_mount_point(link2, true); + rf = path_is_mount_point(file2, 0); + rt = path_is_mount_point(file2, AT_SYMLINK_FOLLOW); + rlf = path_is_mount_point(link2, 0); + rlt = path_is_mount_point(link2, AT_SYMLINK_FOLLOW); assert_se(umount(file2) == 0); -- cgit v1.2.3-54-g00ecf