Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ldd only try the other methods if the previous ones ...



details:   https://anonhg.NetBSD.org/src/rev/337567599770
branches:  trunk
changeset: 371936:337567599770
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Oct 18 19:04:57 2022 +0000

description:
only try the other methods if the previous ones failed.

fixes problem reported by ryoon@

diffstat:

 usr.bin/ldd/ldd.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r a392dc4c5493 -r 337567599770 usr.bin/ldd/ldd.c
--- a/usr.bin/ldd/ldd.c Tue Oct 18 08:18:36 2022 +0000
+++ b/usr.bin/ldd/ldd.c Tue Oct 18 19:04:57 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldd.c,v 1.26 2022/10/15 05:55:45 mrg Exp $     */
+/*     $NetBSD: ldd.c,v 1.27 2022/10/18 19:04:57 mrg Exp $     */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.26 2022/10/15 05:55:45 mrg Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.27 2022/10/18 19:04:57 mrg Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -185,13 +185,14 @@
                }
                /* Alpha never had 32 bit support. */
 #if (defined(_LP64) && !defined(ELF64_ONLY)) || defined(MIPS_N32)
-               if (elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1) {
+               if (failed && elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1) {
                        if (verbose)
                                warnx("%s", error_message);
                        failed = true;
                }
 #if defined(__mips__) && 0 /* XXX this is still hosed for some reason */
-               if (elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1) {
+               if (failed &&
+                   elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1) {
                        if (verbose)
                                warnx("%s", error_message);
                        failed = true;



Home | Main Index | Thread Index | Old Index