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/sundries.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/sundries.c')
-rw-r--r-- | mount/sundries.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/mount/sundries.c b/mount/sundries.c index 45404c5cf..1669554c0 100644 --- a/mount/sundries.c +++ b/mount/sundries.c @@ -224,31 +224,6 @@ matching_opts (const char *options, const char *test_opts) { return 1; } -/* Make a canonical pathname from PATH. Returns a freshly malloced string. - It is up the *caller* to ensure that the PATH is sensible. i.e. - canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.'' - is not a legal pathname for ``/dev/fd0''. Anything we cannot parse - we return unmodified. */ -char * -canonicalize (const char *path) { - char canonical[PATH_MAX+2]; - - if (path == NULL) - return NULL; - -#if 1 - if (streq(path, "none") || - streq(path, "proc") || - streq(path, "devpts")) - return xstrdup(path); -#endif - if (myrealpath (path, canonical, PATH_MAX+1)) - return xstrdup(canonical); - - return xstrdup(path); -} - - /* * Parses NAME=value, returns -1 on parse error, 0 success. The success is also * when the 'spec' doesn't contain name=value pair (because the spec could be |