[BZ 24544] Use support_install_prefix in elf/tst-pldd.c
Carlos O'Donell
codonell@redhat.com
Thu May 9 22:06:00 GMT 2019
On 5/9/19 5:52 PM, Romain Geissler wrote:
> Hi,
>
> This should fix BZ 24544 by using support_install_prefix as suggested
> by Carlos. Tested on my use case with --prefix, I have not tried
> without --prefix, is support_install_prefix equal to "/usr" by
> default, or is it "/", or is it empty ?
support_install_prefix is equal to INSTDIR_PATH which is equal to $(prefix),
that is anything that you pass via --prefix, and by default '/usr'.
> Cheers,
> Romain
>
>
This looks good to me.
Could you please test without --prefix and if that works I'll commit
this for you?
You don't have an FSF copyright assignment, but the following below
is only 8 lines of changes, and so not yet legally significant.
However, if we want to accept more patches from you, you'll need to
get assignment, which should be straight forward:
https://sourceware.org/glibc/wiki/Contribution%20checklist#FSF_copyright_Assignment
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> 2019-05-09 Romain Geissler <romain.geissler@amadeus.com>
>
> [BZ #24544]
> * elf/tst-pldd.c: Include <support/support.h>.
> (PATH_MAX) [!PATH_MAX]: Define PATH_MAX macro.
> (do_test): Use support_install_prefix to compute pldd path.
OK.
>
> From 9a311911c3a74ef11626aaf1b1950d89d0ea20be Mon Sep 17 00:00:00 2001
> From: Romain Geissler <romain.geissler@amadeus.com>
> Date: Thu, 9 May 2019 21:38:42 +0000
> Subject: [PATCH] [BZ #24544] Use support_install_prefix in elf/tst-pldd.c
>
> ---
> elf/tst-pldd.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c
> index 2a9f58936f0..534e28ed502 100644
> --- a/elf/tst-pldd.c
> +++ b/elf/tst-pldd.c
> @@ -25,10 +25,15 @@
> #include <array_length.h>
> #include <gnu/lib-names.h>
>
> +#include <support/support.h>
OK.
> #include <support/subprocess.h>
> #include <support/capture_subprocess.h>
> #include <support/check.h>
>
> +#ifndef PATH_MAX
> +# define PATH_MAX 4096
> +#endif
OK.
> +
> static void
> target_process (void *arg)
> {
> @@ -60,7 +65,9 @@ do_test (void)
> char pid[3 * sizeof (uint32_t) + 1];
> snprintf (pid, array_length (pid), "%d", target.pid);
>
> - const char prog[] = "/usr/bin/pldd";
> + char prog[PATH_MAX] = "";
> + strcpy(prog, support_install_prefix);
> + strcat(prog, "/bin/pldd");
OK.
>
> pldd = support_capture_subprogram (prog,
> (char *const []) { (char *) prog, pid, NULL });
>
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list