From 89fde75b38cf8c99c1cc5c6b6c206de521e551f4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 22 Oct 2007 15:49:26 +0200 Subject: mount: cleanup canonicalize() usage This patch renames canonicalize() to canonicalize_mountpoint() and moves this function to realpath.c where is all cannonicalize code. The canonicalize_mountpoint() function checks for special "none", "proc", "swap" pseudo mointpoint. The patch also adds a new generic canonicalize() function. Signed-off-by: Karel Zak --- mount/fstab.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mount/fstab.c') diff --git a/mount/fstab.c b/mount/fstab.c index 694f4a66a..4d045cea0 100644 --- a/mount/fstab.c +++ b/mount/fstab.c @@ -18,6 +18,7 @@ #include "fsprobe.h" #include "mount_paths.h" #include "nls.h" +#include "realpath.h" #define streq(s, t) (strcmp ((s), (t)) == 0) @@ -325,7 +326,7 @@ getfs_by_specdir (const char *spec, const char *dir) { for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) { /* dir */ if (!streq(mc->m.mnt_dir, dir)) { - char *dr = canonicalize(mc->m.mnt_dir); + char *dr = canonicalize_mountpoint(mc->m.mnt_dir); int ok = 0; if (streq(dr, dir)) @@ -371,7 +372,7 @@ getfs_by_dir (const char *dir) { if (streq(mc->m.mnt_dir, dir)) return mc; - cdir = canonicalize(dir); + cdir = canonicalize_mountpoint(dir); for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) { if (streq(mc->m.mnt_dir, cdir)) { free(cdir); @@ -823,7 +824,9 @@ struct my_mntent *my_getmntent (mntFILE *mfp) { return NULL; } mntFILE *my_setmntent (const char *file, char *mode) { return NULL; } void my_endmntent (mntFILE *mfp) { } int my_addmntent (mntFILE *mfp, struct my_mntent *mnt) { return 0; } -char *myrealpath(const char *path, char *resolved_path, int m) { return NULL; } + +char *canonicalize (const char *path) { return NULL; } +char *canonicalize_mountpoint (const char *path) { return NULL; } int main(int argc, char **argv) -- cgit v1.2.3-55-g7522