diff options
author | Karel Zak | 2007-10-22 15:49:26 +0200 |
---|---|---|
committer | Karel Zak | 2007-10-25 21:50:59 +0200 |
commit | 89fde75b38cf8c99c1cc5c6b6c206de521e551f4 (patch) | |
tree | 51fcd85dad2bc9421e619ec696f8795cdae235f5 /mount/fstab.c | |
parent | docs: add info about .bugfix releases and branches (diff) | |
download | kernel-qcow2-util-linux-89fde75b38cf8c99c1cc5c6b6c206de521e551f4.tar.gz kernel-qcow2-util-linux-89fde75b38cf8c99c1cc5c6b6c206de521e551f4.tar.xz kernel-qcow2-util-linux-89fde75b38cf8c99c1cc5c6b6c206de521e551f4.zip |
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 <kzak@redhat.com>
Diffstat (limited to 'mount/fstab.c')
-rw-r--r-- | mount/fstab.c | 9 |
1 files changed, 6 insertions, 3 deletions
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) |