mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Remove the KERN_PROC_CWD the proc_current_path format (which is the only
thing that uses it now).
This commit is contained in:
15
procname.c
15
procname.c
@ -37,7 +37,6 @@
|
||||
|
||||
struct kinfo_proc *cmp_procs(struct kinfo_proc *, struct kinfo_proc *);
|
||||
char *get_proc_name(int, char *);
|
||||
char *get_proc_cwd(int);
|
||||
|
||||
struct kinfo_proc *
|
||||
cmp_procs(struct kinfo_proc *p1, struct kinfo_proc *p2)
|
||||
@ -132,17 +131,3 @@ error:
|
||||
free(buf);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
char*
|
||||
get_proc_cwd(int fd)
|
||||
{
|
||||
int name[] = { CTL_KERN, KERN_PROC_CWD, 0 };
|
||||
static char path[MAXPATHLEN];
|
||||
size_t pathlen = sizeof path;
|
||||
|
||||
if ((name[2] = tcgetpgrp(fd)) == -1)
|
||||
return (NULL);
|
||||
if (sysctl(name, 3, path, &pathlen, NULL, 0) != 0)
|
||||
return (NULL);
|
||||
return (path);
|
||||
}
|
||||
|
Reference in New Issue
Block a user