From 8285241eed07d9bc5f2622858d868ec0d17173bf Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Thu, 30 May 2024 20:49:56 +0200 Subject: [PATCH] Revert "Get full path on FreeBSD" KERN_PROC_ARGS fails on FreeBSD is file doesn't exist This reverts commit dfa821de3dc89fdcd8b3f6308ae02b154fe87ee3. --- bsd/kinfo_getargv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bsd/kinfo_getargv.c b/bsd/kinfo_getargv.c index 58daabc..9c0879c 100644 --- a/bsd/kinfo_getargv.c +++ b/bsd/kinfo_getargv.c @@ -14,6 +14,7 @@ static char *kinfo_getpathname(pid_t); +#if !defined(__FreeBSD__) static char *xbasename(char *s); static char * @@ -21,6 +22,7 @@ xbasename(char *s) { char *t = strrchr(s, '/'); return (t == NULL ? (char *)s : ++t); } +#endif static char * kinfo_getpathname(pid_t pid) @@ -96,6 +98,7 @@ kinfo_getargv(pid_t pid) if (argv == NULL) goto bad; +#if !defined(__FreeBSD__) if (buf[0] != '/') { argv[0] = kinfo_getpathname(pid); if (argv[0] != NULL) { @@ -106,6 +109,7 @@ kinfo_getargv(pid_t pid) free(argv[0]); } } +#endif for (; i < argc; i++) { argv[i] = strdup(buf + off);