Linux RAID subsystem development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: John Spencer <maillist-mdadm@barfooze.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] mdadm: fix portability issues encountered while building against musl libc
Date: Sun, 10 Feb 2013 15:45:48 +1100	[thread overview]
Message-ID: <20130210154548.0ad0c36d@notabene.brown> (raw)
In-Reply-To: <5116D8A7.6070409@barfooze.de>

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]

On Sun, 10 Feb 2013 00:15:51 +0100 John Spencer <maillist-mdadm@barfooze.de>
wrote:

> >From 23114b8c77982717cc3ce3d437321c7fb0b1c918 Mon Sep 17 00:00:00 2001
> From: John Spencer <maillist-mdadm@barfooze.de>
> Date: Sat, 2 Feb 2013 17:26:45 +0100
> Subject: [PATCH 1/3] 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>
> ---
>  platform-intel.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/platform-intel.c b/platform-intel.c
> index 0dcf07c..d8d4942 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++;
> @@ -459,7 +459,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)


Hi,
 I've applied this one and the GCC #ifdef - thanks.

 I haven't applied the last one, but not because I don't appreciate being
 called insane :-)

 I like having -Werror as it encourages people to report any warnings they
 get, and it keeps me "honest".
 If it is a problem for you, you can easily
   make CWFLAGS=

 or set the C Warning FLAGS to whatever you like - they are deliberately kept
 separate from other CFLAGS.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2013-02-10  4:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 23:15 [PATCH] mdadm: fix portability issues encountered while building against musl libc John Spencer
2013-02-09 23:40 ` Joseph Glanville
2013-02-10  4:45 ` NeilBrown [this message]
2013-02-11 19:34   ` John Spencer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130210154548.0ad0c36d@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=maillist-mdadm@barfooze.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox