unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Cc: Carlos O'Donell <codonell@redhat.com>
Subject: [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
Date: Mon, 13 May 2019 13:59:52 -0300	[thread overview]
Message-ID: <20190513165952.28972-3-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20190513165952.28972-1-adhemerval.zanella@linaro.org>

Use a new libsupport support_bindir_prefix instead of a hardcoded
/usr/bin to create the pldd path on container directory.

Checked on x86_64-linux-gnu with default and non-default --prefix and
--bindir paths, as well with --enable-hardcoded-path-in-tests.

	[BZ #24544]
	* elf/tst-pldd.c (do_test): Use support_bindir_prefix instead of
	pre-defined value.
---
 elf/tst-pldd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c
index 2a9f58936f..6b7c94a1c0 100644
--- a/elf/tst-pldd.c
+++ b/elf/tst-pldd.c
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -28,6 +29,7 @@
 #include <support/subprocess.h>
 #include <support/capture_subprocess.h>
 #include <support/check.h>
+#include <support/support.h>
 
 static void
 target_process (void *arg)
@@ -60,12 +62,14 @@ 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 = xasprintf ("%s/pldd", support_bindir_prefix);
 
     pldd = support_capture_subprogram (prog,
       (char *const []) { (char *) prog, pid, NULL });
 
     support_capture_subprocess_check (&pldd, "pldd", 0, sc_allow_stdout);
+
+    free (prog);
   }
 
   /* Check 'pldd' output.  The test is expected to be linked against only
-- 
2.17.1


  parent reply	other threads:[~2019-05-13 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 16:59 [PATCH 1/3] Make --bindir effetive Adhemerval Zanella
2019-05-13 16:59 ` [PATCH 2/3] support: Export bindir path on support_path Adhemerval Zanella
2019-05-13 20:59   ` DJ Delorie
2019-05-13 16:59 ` Adhemerval Zanella [this message]
2019-05-13 21:02   ` [PATCH 3/3] elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544) DJ Delorie
2019-05-18 19:07   ` Rafal Luzynski
2019-05-20  9:12     ` Florian Weimer
2019-05-13 20:57 ` [PATCH 1/3] Make --bindir effetive DJ Delorie

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=20190513165952.28972-3-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=codonell@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).