From: John Spencer Date: Sat, 2 Feb 2013 16:26:45 +0000 (+0100) Subject: platform-intel: canonicalize_file_name() is not portable X-Git-Tag: mdadm-3.3-rc1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3635eee6409f12688adf3dd36f69cb457aafc72;p=thirdparty%2Fmdadm.git 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 Signed-off-by: NeilBrown --- 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)