summaryrefslogtreecommitdiff
path: root/platform-intel.c
diff options
context:
space:
mode:
authorJohn Spencer <maillist-mdadm@barfooze.de>2013-02-02 17:26:45 +0100
committerNeilBrown <neilb@suse.de>2013-02-10 15:40:47 +1100
commite3635eee6409f12688adf3dd36f69cb457aafc72 (patch)
tree5d525a341811dc4ff7718c3d1d704d7f5312d245 /platform-intel.c
parentdef1133297d8f619c8fd644d6d8c6633ddcaa929 (diff)
platform-intel: canonicalize_file_name() is not portable
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>
Diffstat (limited to 'platform-intel.c')
-rw-r--r--platform-intel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform-intel.c b/platform-intel.c
index 435a9b99..f91c9711 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -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)