]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
platform-intel: canonicalize_file_name() is not portable
authorJohn Spencer <maillist-mdadm@barfooze.de>
Sat, 2 Feb 2013 16:26:45 +0000 (17:26 +0100)
committerNeilBrown <neilb@suse.de>
Sun, 10 Feb 2013 04:40:47 +0000 (15:40 +1100)
this is a GLIBC specific feature and should not be used.

according to its manpage:
"The call canonicalize_file_name(path) is equivalent
to the call realpath(path, NULL)."

thus, we use realpath so it works everywhere.

Signed-off-by: John Spencer <maillist-mdadm@barfooze.de>
Signed-off-by: NeilBrown <neilb@suse.de>
platform-intel.c

index 435a9b9963d2adaf389b891e455a689a9e40991f..f91c97110ff30b37316021b7367c5ae1883afef1 100644 (file)
@@ -116,7 +116,7 @@ struct sys_dev *find_driver_devices(const char *bus, const char *driver)
 
                list->dev_id = (__u16) dev_id;
                list->type = type;
-               list->path = canonicalize_file_name(path);
+               list->path = realpath(path, NULL);
                list->next = NULL;
                if ((list->pci_id = strrchr(list->path, '/')) != NULL)
                        list->pci_id++;
@@ -460,7 +460,7 @@ char *devt_to_devpath(dev_t dev)
        char device[46];
 
        sprintf(device, "/sys/dev/block/%d:%d/device", major(dev), minor(dev));
-       return canonicalize_file_name(device);
+       return realpath(device, NULL);
 }
 
 char *diskfd_to_devpath(int fd)