Source-Changes-HG archive

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

[src/netbsd-10]: src/usr.bin/ldd Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/1d5ccb62ed6a
branches:  netbsd-10
changeset: 373008:1d5ccb62ed6a
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jan 12 12:05:20 2023 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #41):

        usr.bin/ldd/ldd.c: revision 1.28

avoid printing the latest error message if some ldd method worked.

diffstat:

 usr.bin/ldd/ldd.c |  28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diffs (65 lines):

diff -r cf21695844fb -r 1d5ccb62ed6a usr.bin/ldd/ldd.c
--- a/usr.bin/ldd/ldd.c Sat Jan 07 15:02:00 2023 +0000
+++ b/usr.bin/ldd/ldd.c Thu Jan 12 12:05:20 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldd.c,v 1.27 2022/10/18 19:04:57 mrg Exp $     */
+/*     $NetBSD: ldd.c,v 1.27.2.1 2023/01/12 12:05:20 martin 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.27 2022/10/18 19:04:57 mrg Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.27.2.1 2023/01/12 12:05:20 martin Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -124,7 +124,7 @@
        const char *fmt1 = NULL, *fmt2 = NULL;
        int c, exit_status = EXIT_SUCCESS;
        char cwd[MAXPATHLEN], path[MAXPATHLEN];
-       bool verbose = false, failed = false;
+       bool verbose = false;
 
 #ifdef DEBUG
        debug = 1;
@@ -164,6 +164,7 @@
 
        for (; argc != 0; argc--, argv++) {
                int fd;
+               bool failed = false;
 
                if (**argv != '/') {
                        strcpy(path, cwd);
@@ -185,17 +186,20 @@
                }
                /* Alpha never had 32 bit support. */
 #if (defined(_LP64) && !defined(ELF64_ONLY)) || defined(MIPS_N32)
-               if (failed && elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1) {
-                       if (verbose)
-                               warnx("%s", error_message);
-                       failed = true;
+               if (failed) {
+                       if (elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1) {
+                               if (verbose)
+                                       warnx("%s", error_message);
+                       } else
+                               failed = false;
                }
 #if defined(__mips__) && 0 /* XXX this is still hosed for some reason */
-               if (failed &&
-                   elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1) {
-                       if (verbose)
-                               warnx("%s", error_message);
-                       failed = true;
+               if (failed) {
+                       if (elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1) {
+                               if (verbose)
+                                       warnx("%s", error_message);
+                       } else
+                               failed = false;
                }
 #endif
 #endif



Home | Main Index | Thread Index | Old Index