public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH 2/3] Fix tst-ldconfig-ld_so_conf-update with custom configure prefix value
Date: Mon, 27 Mar 2023 14:24:19 -0300	[thread overview]
Message-ID: <f74b4bee-020a-8736-3bfe-88be4fc7fbb0@linaro.org> (raw)
In-Reply-To: <20230326200016.219-3-romain.geissler@amadeus.com>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>


On 26/03/23 17:00, Romain Geissler via Libc-alpha wrote:
> ---
>  elf/tst-ldconfig-ld_so_conf-update.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/elf/tst-ldconfig-ld_so_conf-update.c b/elf/tst-ldconfig-ld_so_conf-update.c
> index 503afb3211e..2c5c48615d8 100644
> --- a/elf/tst-ldconfig-ld_so_conf-update.c
> +++ b/elf/tst-ldconfig-ld_so_conf-update.c
> @@ -33,7 +33,6 @@
>  
>  #define DSO "libldconfig-ld-mod.so"
>  #define DSO_DIR "/tmp/tst-ldconfig"
> -#define CONF "/etc/ld.so.conf"
>  
>  
>  static void
> @@ -64,6 +63,8 @@ do_test (void)
>  {
>    struct support_capture_subprocess result;
>  
> +  char *conf_path = xasprintf ("%s/ld.so.conf", support_sysconfdir_prefix);
> +
>    /* Create the needed directories.  */
>    xmkdirp ("/var/cache/ldconfig", 0777);
>    xmkdirp (DSO_DIR, 0777);
> @@ -82,9 +83,9 @@ do_test (void)
>       is not searched.  */
>    TEST_VERIFY_EXIT (dlopen (DSO, RTLD_NOW | RTLD_GLOBAL) == NULL);
>  
> -  FILE *fp = xfopen (CONF, "a+");
> +  FILE *fp = xfopen (conf_path, "a+");
>    if (!fp)
> -    FAIL_EXIT1 ("creating /etc/ld.so.conf failed: %m");
> +    FAIL_EXIT1 ("creating %s failed: %m", conf_path);
>    xfclose (fp);
>  
>    /* Run ldconfig.  */
> @@ -95,9 +96,9 @@ do_test (void)
>    TEST_VERIFY_EXIT (dlopen (DSO, RTLD_NOW | RTLD_GLOBAL) == NULL);
>  
>    /* Add tst-ldconfig directory to /etc/ld.so.conf.  */
> -  fp = xfopen (CONF, "w");
> +  fp = xfopen (conf_path, "w");
>    if (!(fwrite (DSO_DIR, 1, sizeof (DSO_DIR), fp)))
> -    FAIL_EXIT1 ("updating /etc/ld.so.conf failed: %m");
> +    FAIL_EXIT1 ("updating %s failed: %m", conf_path);
>    xfclose (fp);
>  
>    /* Try to dlopen the same DSO again, we expect this to still fail.  */
> @@ -111,6 +112,8 @@ do_test (void)
>    /* Finally, we expect dlopen to pass now.  */
>    TEST_VERIFY_EXIT (dlopen (DSO, RTLD_NOW | RTLD_GLOBAL) != NULL);
>  
> +  free (conf_path);
> +
>    return 0;
>  }
>  

  reply	other threads:[~2023-03-27 17:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 20:00 [PATCH 0/3] Fix tst-ldconfig-ld_so_conf-update and tst-glibc-hwcaps-prepend-cache " Romain Geissler
2023-03-26 20:00 ` [PATCH 1/3] support: introduce support_sysconfdir_prefix Romain Geissler
2023-03-27 17:24   ` Adhemerval Zanella Netto
2023-03-26 20:00 ` [PATCH 2/3] Fix tst-ldconfig-ld_so_conf-update with custom configure prefix value Romain Geissler
2023-03-27 17:24   ` Adhemerval Zanella Netto [this message]
2023-03-26 20:00 ` [PATCH 3/3] Fix tst-glibc-hwcaps-prepend-cache " Romain Geissler
2023-03-27 17:24   ` Adhemerval Zanella Netto

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=f74b4bee-020a-8736-3bfe-88be4fc7fbb0@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --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).