diff options
author | des <des@FreeBSD.org> | 2001-12-08 22:34:14 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-12-08 22:34:14 +0000 |
commit | 21823ec3f86860088808338133f86fe37014be23 (patch) | |
tree | 676c8b9ceebea9e5c2b9b0302820bc017f5b1acf /sys | |
parent | 8496a60c31fd9e35c200728a2c8ba1f2879cadd9 (diff) | |
download | FreeBSD-src-21823ec3f86860088808338133f86fe37014be23.zip FreeBSD-src-21823ec3f86860088808338133f86fe37014be23.tar.gz |
Fix a KSEfication brain-o in procfs_doprocfile(): return the path of the target process,
not the calling process. While we're here, also unstaticize procfs_doprocfile() and
procfs_docurproc() so linprocfs can call them directly instead of duplicating them.
Submitted by: Dominic Mitchell <dom@semantico.com>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/procfs/procfs.c | 6 | ||||
-rw-r--r-- | sys/fs/procfs/procfs.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c index e4883d4..18544d0 100644 --- a/sys/fs/procfs/procfs.c +++ b/sys/fs/procfs/procfs.c @@ -64,13 +64,13 @@ /* * Filler function for proc/pid/self */ -static int +int procfs_doprocfile(PFS_FILL_ARGS) { char *fullpath = "unknown"; char *freepath = NULL; - vn_fullpath(td, td->td_proc->p_textvp, &fullpath, &freepath); + vn_fullpath(td, p->p_textvp, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); @@ -80,7 +80,7 @@ procfs_doprocfile(PFS_FILL_ARGS) /* * Filler function for proc/curproc */ -static int +int procfs_docurproc(PFS_FILL_ARGS) { sbuf_printf(sb, "%ld", (long)td->td_proc->p_pid); diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index 059cab8..bf5b756 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/procfs/procfs.h @@ -42,9 +42,11 @@ #ifdef _KERNEL +int procfs_docurproc(PFS_FILL_ARGS); int procfs_doproccmdline(PFS_FILL_ARGS); int procfs_doprocctl(PFS_FILL_ARGS); int procfs_doprocdbregs(PFS_FILL_ARGS); +int procfs_doprocfile(PFS_FILL_ARGS); int procfs_doprocfpregs(PFS_FILL_ARGS); int procfs_doprocmap(PFS_FILL_ARGS); int procfs_doprocmem(PFS_FILL_ARGS); |