From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] libqmi: musl compat canonicalize_file_name
Date: Thu, 4 May 2017 21:39:22 +0200 [thread overview]
Message-ID: <20170504213922.18fc60ea@free-electrons.com> (raw)
In-Reply-To: <1493688546-37339-1-git-send-email-matthew.weber@rockwellcollins.com>
Hello,
On Mon, 1 May 2017 20:29:06 -0500, Matt Weber wrote:
> ++#ifndef HAVE_CANONICALIZE_FILE_NAME
> ++#include <limits.h>
> ++#include <string.h>
> ++#include <stdlib.h>
> ++#include <stdio.h>
> ++static char * canonicalize_file_name(const char *path)
> ++{
> ++ char buf[PATH_MAX] = { };
> ++
> ++ snprintf(buf, sizeof(buf) - 1, "%s", path);
> ++
> ++ if (!realpath(path, buf))
> ++ return NULL;
> ++
> ++ return strdup(buf);
> ++}
> ++#endif
This has been insufficiently tested: while it fixes the build with
musl, it breaks the build with glibc and uclibc. Indeed, those C
libraries already provide canonicalize_file_name(), causing a
redefinition error.
You forgot to add an AC_CHECK_FUNCS() check in configure.ac. I've
committed a fix that adds it.
Please try to test more carefully the fixes.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
prev parent reply other threads:[~2017-05-04 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 1:29 [Buildroot] [PATCH 1/1] libqmi: musl compat canonicalize_file_name Matt Weber
2017-05-04 15:13 ` Thomas Petazzoni
2017-05-04 19:39 ` Thomas Petazzoni [this message]
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=20170504213922.18fc60ea@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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