Skip to content

Commit

Permalink
Get full path on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed May 30, 2024
1 parent 6698756 commit dfa821d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions bsd/kinfo_getargv.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

static char *kinfo_getpathname(pid_t);

#if !defined(__FreeBSD__)
static char *xbasename(char *s);

static char *
xbasename(char *s) {
char *t = strrchr(s, '/');
return (t == NULL ? (char *)s : ++t);
}
#endif

static char *
kinfo_getpathname(pid_t pid)
Expand Down Expand Up @@ -98,7 +96,6 @@ 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) {
Expand All @@ -109,7 +106,6 @@ kinfo_getargv(pid_t pid)
free(argv[0]);
}
}
#endif

for (; i < argc; i++) {
argv[i] = strdup(buf + off);
Expand Down

0 comments on commit dfa821d

Please sign in to comment.