1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00
freebsd-ports/misc/hxtools/files/patch-sadmin_psthreads.c
Alexey Dokuchaev f423ead6e5 This is the collection of tools and scripts for different tasks written
by Jan Engelhardt, each of which seems to be too small to warrant their
own project.

WWW: http://inai.de/projects/hxtools/
2020-08-03 06:13:13 +00:00

42 lines
1.5 KiB
C

--- sadmin/psthreads.c.orig 2020-07-12 09:44:16 UTC
+++ sadmin/psthreads.c
@@ -141,15 +141,15 @@ static struct kps_proc_data *kps_proc_read_one(unsigne
HXlist_init(&task->process_children);
task->cmdlen = 0;
- snprintf(buf, sizeof(buf), "/proc/%u/cmdline", pid);
+ snprintf(buf, sizeof(buf), "/compat/linux/proc/%u/cmdline", pid);
if ((fd = open(buf, O_RDONLY)) >= 0)
kps_read_cmdline(task, fd);
- snprintf(buf, sizeof(buf), "/proc/%u/status", pid);
+ snprintf(buf, sizeof(buf), "/compat/linux/proc/%u/status", pid);
if ((fp = fopen(buf, "r")) != NULL)
kps_read_status(task, fp);
- snprintf(buf, sizeof(buf), "/proc/%u/stat", pid);
+ snprintf(buf, sizeof(buf), "/compat/linux/proc/%u/stat", pid);
if ((fp = fopen(buf, "r")) != NULL)
kps_read_stat(task, fp);
@@ -162,8 +162,8 @@ static void kps_proc_read(struct HXmap *tree)
char buf[64];
struct HXdir *dproc, *dthr;
- if ((dproc = HXdir_open("/proc")) == NULL) {
- fprintf(stderr, "Could not open /proc: %s\n", strerror(errno));
+ if ((dproc = HXdir_open("/compat/linux/proc")) == NULL) {
+ fprintf(stderr, "Could not open /compat/linux/proc: %s\n", strerror(errno));
return;
}
@@ -175,7 +175,7 @@ static void kps_proc_read(struct HXmap *tree)
if (end == dentry || *end != '\0')
continue;
- snprintf(buf, sizeof(buf), "/proc/%u/task", tgid);
+ snprintf(buf, sizeof(buf), "/compat/linux/proc/%u/task", tgid);
if ((dthr = HXdir_open(buf)) == NULL) {
fprintf(stderr, "Could not open %s: %s\n", buf, strerror(errno));
continue;