summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2015-05-29 17:13:12 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2015-05-29 17:42:44 +0200
commite26d6ce517a49c246141ed20528614823c2f5799 (patch)
tree1c69999b21f15b189c3e7d21fb5dd766bf75835b /src/test
parent5d409034017e9f9f8c4392157d95511fc2e05d87 (diff)
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.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-path-util.c32
1 files changed, 16 insertions, 16 deletions
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);