summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2021-04-10 11:46:57 +0200
committerBenBE <BenBE@geshi.org>2021-05-23 09:22:21 +0200
commit94a52cb5c9274fe021b3fc114180294cadb598b4 (patch)
tree9d00199d74bc600283ae007464de65cc27377edd /darwin
parent666f70c58c9fcd6bc27ed93b7958efd7a064133a (diff)
Rename cmdlineBasenameOffset to cmdlineBasenameEnd to properly indicate the fields purpose
Diffstat (limited to 'darwin')
-rw-r--r--darwin/DarwinProcess.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c
index 9e55c0fa..65f45ee1 100644
--- a/darwin/DarwinProcess.c
+++ b/darwin/DarwinProcess.c
@@ -101,7 +101,7 @@ bool Process_isThread(const Process* this) {
return false;
}
-static char* DarwinProcess_getCmdLine(const struct kinfo_proc* k, int* cmdlineBasenameOffset) {
+static char* DarwinProcess_getCmdLine(const struct kinfo_proc* k, int* cmdlineBasenameEnd) {
/* This function is from the old Mac version of htop. Originally from ps? */
int mib[3], argmax, nargs, c = 0;
size_t size;
@@ -199,7 +199,7 @@ static char* DarwinProcess_getCmdLine(const struct kinfo_proc* k, int* cmdlineBa
/* Save where the argv[0] string starts. */
sp = cp;
- *cmdlineBasenameOffset = 0;
+ *cmdlineBasenameEnd = 0;
for ( np = NULL; c < nargs && cp < &procargs[size]; cp++ ) {
if ( *cp == '\0' ) {
c++;
@@ -209,8 +209,8 @@ static char* DarwinProcess_getCmdLine(const struct kinfo_proc* k, int* cmdlineBa
}
/* Note location of current '\0'. */
np = cp;
- if (*cmdlineBasenameOffset == 0) {
- *cmdlineBasenameOffset = cp - sp;
+ if (*cmdlineBasenameEnd == 0) {
+ *cmdlineBasenameEnd = cp - sp;
}
}
}
@@ -223,8 +223,8 @@ static char* DarwinProcess_getCmdLine(const struct kinfo_proc* k, int* cmdlineBa
/* Empty or unterminated string. */
goto ERROR_B;
}
- if (*cmdlineBasenameOffset == 0) {
- *cmdlineBasenameOffset = np - sp;
+ if (*cmdlineBasenameEnd == 0) {
+ *cmdlineBasenameEnd = np - sp;
}
/* Make a copy of the string. */
@@ -239,7 +239,7 @@ ERROR_B:
free( procargs );
ERROR_A:
- *cmdlineBasenameOffset = -1;
+ *cmdlineBasenameEnd = -1;
retval = xStrdup(k->kp_proc.p_comm);
return retval;
@@ -287,7 +287,7 @@ void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps,
proc->starttime_ctime = ep->p_starttime.tv_sec;
Process_fillStarttimeBuffer(proc);
- proc->cmdline = DarwinProcess_getCmdLine(ps, &proc->cmdlineBasenameOffset);
+ proc->cmdline = DarwinProcess_getCmdLine(ps, &proc->cmdlineBasenameEnd);
}
/* Mutable information */

© 2014-2024 Faster IT GmbH | imprint | privacy policy