From cc06a01ec551ed2bcd397a5097165b4434179b34 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 10 Mar 2015 13:35:56 +0100 Subject: libmount: cleanup fs root detection code Signed-off-by: Karel Zak --- libmount/src/utils.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'libmount/src/utils.c') diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 6f4d1a19f..bc43a85cf 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -1010,28 +1010,6 @@ err: return NULL; } -char *mnt_get_fs_root(const char *path, const char *mnt) -{ - char *m = (char *) mnt, *res; - const char *p; - size_t sz; - - if (!m) - m = mnt_get_mountpoint(path); - if (!m) - return NULL; - - sz = strlen(m); - p = sz > 1 ? path + sz : path; - - if (m != mnt) - free(m); - - res = *p ? strdup(p) : strdup("/"); - DBG(UTILS, ul_debug("%s fs-root is %s", path, res)); - return res; -} - /* * Search for @name kernel command parametr. * @@ -1176,17 +1154,6 @@ int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[]) return 0; } -int test_fsroot(struct libmnt_test *ts, int argc, char *argv[]) -{ - char *path = canonicalize_path(argv[1]), - *mnt = path ? mnt_get_fs_root(path, NULL) : NULL; - - printf("%s: %s\n", argv[1], mnt ? : "unknown"); - free(mnt); - free(path); - return 0; -} - int test_filesystems(struct libmnt_test *ts, int argc, char *argv[]) { char **filesystems = NULL; @@ -1277,7 +1244,6 @@ int main(int argc, char *argv[]) { "--ends-with", test_endswith, " " }, { "--append-string", test_appendstr, " " }, { "--mountpoint", test_mountpoint, "" }, - { "--fs-root", test_fsroot, "" }, { "--cd-parent", test_chdir, "" }, { "--kernel-cmdline",test_kernel_cmdline, "