Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Sep 2023 13:05:30 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 205f9a4fbc82 - stable/12 - libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum
Message-ID:  <202309261305.38QD5U9q052135@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=205f9a4fbc82bdf8c8a7e5de4ef053c238d4769e

commit 205f9a4fbc82bdf8c8a7e5de4ef053c238d4769e
Author:     John Hein <jcfyecrayz@liamekaens.com>
AuthorDate: 2023-09-21 23:43:05 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-09-26 13:05:16 +0000

    libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum
    
    PR:             273966
    Reviewed by:    emaste
    
    (cherry picked from commit 633094c27f0ac1b1001d5bd24a883240b4bce1dc)
    (cherry picked from commit fd8bf2ecc05af841aa7e8369a43861cdc122d404)
---
 lib/libprocstat/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libprocstat/core.c b/lib/libprocstat/core.c
index c3d5f8bec495..dc05991f3372 100644
--- a/lib/libprocstat/core.c
+++ b/lib/libprocstat/core.c
@@ -121,7 +121,7 @@ procstat_core_open(const char *filename)
 		warnx("%s is not a CORE file", filename);
 		goto fail;
 	}
-	if (elf_getphnum(e, &nph) == 0) {
+	if (elf_getphdrnum(e, &nph) == -1) {
 		warnx("program headers not found");
 		goto fail;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309261305.38QD5U9q052135>