diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2020-08-03 06:13:13 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2020-08-03 06:13:13 +0000 |
commit | f423ead6e5b2e51b0ff08ab3e0f8e846d41223ad (patch) | |
tree | e4fd373e96a1da6d9d1a4e56dd2c86b414f49752 /misc/hxtools/files/patch-sadmin_ofl.c | |
parent | Has expired, please use devel/rubygem-grape instead. (diff) |
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/
Notes
Notes:
svn path=/head/; revision=544024
Diffstat (limited to 'misc/hxtools/files/patch-sadmin_ofl.c')
-rw-r--r-- | misc/hxtools/files/patch-sadmin_ofl.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/misc/hxtools/files/patch-sadmin_ofl.c b/misc/hxtools/files/patch-sadmin_ofl.c new file mode 100644 index 000000000000..ba796a9ef620 --- /dev/null +++ b/misc/hxtools/files/patch-sadmin_ofl.c @@ -0,0 +1,57 @@ +--- sadmin/ofl.c.orig 2020-07-12 09:44:16 UTC ++++ sadmin/ofl.c +@@ -42,7 +42,7 @@ static const char *ofl_comm(pid_t pid, char *buf, size + const char *p; + ssize_t ret; + +- snprintf(src, sizeof(src), "/proc/%u/exe", (unsigned int)pid); ++ snprintf(src, sizeof(src), "/compat/linux/proc/%u/exe", (unsigned int)pid); + ret = readlink(src, dst, sizeof(dst) - 1); + if (ret < 0) { + *buf = '\0'; +@@ -227,7 +227,7 @@ static bool ofl(const char *mnt, unsigned int signum) + char tmp[256]; + struct HXdir *dir; + +- dir = HXdir_open("/proc"); ++ dir = HXdir_open("/compat/linux/proc"); + if (dir == NULL) + return false; + while ((de = HXdir_read(dir)) != NULL) { +@@ -236,30 +236,30 @@ static bool ofl(const char *mnt, unsigned int signum) + data.pid = strtoul(de, NULL, 0); + if (data.pid == 0) + continue; +- snprintf(tmp, sizeof(tmp), "/proc/%s", de); ++ snprintf(tmp, sizeof(tmp), "/compat/linux/proc/%s", de); + if (lstat(tmp, &data.sb) < 0 || !S_ISDIR(data.sb.st_mode)) + continue; + + /* Program map */ +- snprintf(tmp, sizeof(tmp), "/proc/%s/maps", de); ++ snprintf(tmp, sizeof(tmp), "/compat/linux/proc/%s/maps", de); + if (ofl_pmap(mnt, tmp, &data)) + continue; + + /* Basic links */ + data.check = true; +- snprintf(tmp, sizeof(tmp), "/proc/%s/root", de); ++ snprintf(tmp, sizeof(tmp), "/compat/linux/proc/%s/root", de); + if (ofl_one(mnt, tmp, &data)) + continue; +- snprintf(tmp, sizeof(tmp), "/proc/%s/cwd", de); ++ snprintf(tmp, sizeof(tmp), "/compat/linux/proc/%s/cwd", de); + if (ofl_one(mnt, tmp, &data)) + continue; +- snprintf(tmp, sizeof(tmp), "/proc/%s/exe", de); ++ snprintf(tmp, sizeof(tmp), "/compat/linux/proc/%s/exe", de); + if (ofl_one(mnt, tmp, &data)) + continue; + + /* All file descriptors */ + data.check = false; +- snprintf(tmp, sizeof(tmp), "/proc/%s/task", de); ++ snprintf(tmp, sizeof(tmp), "/compat/linux/proc/%s/task", de); + ofl_task(mnt, tmp, &data); + } + |