ldconfig: Do not print a warning for a missing ld.so.conf file
diff mbox series

Message ID 878snla9ft.fsf@oldenburg2.str.redhat.com
State New
Headers show
Series
  • ldconfig: Do not print a warning for a missing ld.so.conf file
Related show

Commit Message

Florian Weimer Dec. 9, 2019, 1:57 p.m. UTC
The configuration file is not needed for working system, so printing a
warning is not helpful.

-----
 elf/ldconfig.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Carlos O'Donell Dec. 10, 2019, 7:44 p.m. UTC | #1
On 12/9/19 8:57 AM, Florian Weimer wrote:
> The configuration file is not needed for working system, so printing a
> warning is not helpful.

Agreed. This annoys me to no end, but I have never gotten around to fixing it.
I see it at the end of ever one of my test installs for a full build.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> -----
>  elf/ldconfig.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/elf/ldconfig.c b/elf/ldconfig.c
> index 139161b3a6..62bbe77a88 100644
> --- a/elf/ldconfig.c
> +++ b/elf/ldconfig.c
> @@ -1079,9 +1079,10 @@ parse_conf (const char *filename, bool do_chroot)
>  
>    if (file == NULL)
>      {
> -      error (0, errno, _("\
> +      if (errno != ENOENT)
> +	error (0, errno, _("\
>  Warning: ignoring configuration file that cannot be opened: %s"),
> -	     canon);
> +	       canon);
>        if (canon != filename)
>  	free ((char *) canon);
>        return;
>

Patch
diff mbox series

diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 139161b3a6..62bbe77a88 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -1079,9 +1079,10 @@  parse_conf (const char *filename, bool do_chroot)
 
   if (file == NULL)
     {
-      error (0, errno, _("\
+      if (errno != ENOENT)
+	error (0, errno, _("\
 Warning: ignoring configuration file that cannot be opened: %s"),
-	     canon);
+	       canon);
       if (canon != filename)
 	free ((char *) canon);
       return;