summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvaldaarhun <icegambit91@gmail.com>2022-08-10 16:52:06 +0530
committercgzones <cgzones@googlemail.com>2022-08-29 19:19:35 +0200
commit7b83459a6795e6cba2528da294a177e4b0329c6a (patch)
tree2f28761259877b9fc891a3077a0ec3fa814cd608
parenta52f6d43542e66b0426e02b6af3589185c29335b (diff)
Fix code style and make other minor changes
Co-authored-by: BenBE <BenBE@geshi.org>
-rw-r--r--linux/LinuxProcessList.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index ac115f24..b6b88405 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -779,15 +779,15 @@ static bool LinuxProcessList_checkPidNamespace(Process *process, openat_arg_t pr
char *ptr = buffer;
int pid_ns_count = 0;
- while(*ptr != '\0' && *ptr != '\n' && !isdigit(*ptr))
+ while (*ptr && *ptr != '\n' && !isdigit(*ptr))
++ptr;
- while(*ptr != '\0' && *ptr != '\n') {
+ while (*ptr && *ptr != '\n') {
if (isdigit(*ptr))
pid_ns_count++;
- while(isdigit(*ptr))
+ while (isdigit(*ptr))
++ptr;
- while(*ptr != '\0' && *ptr != '\n' && !isdigit(*ptr))
+ while (*ptr && *ptr != '\n' && !isdigit(*ptr))
++ptr;
}
@@ -1550,11 +1550,12 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
LinuxProcessList_recurseProcTree(this, procFd, "task", proc, period);
- if ((ss->flags & PROCESS_FLAG_LINUX_CGROUP) || hideRunningInContainer) {
+ if (ss->flags & PROCESS_FLAG_LINUX_CGROUP || hideRunningInContainer) {
LinuxProcessList_readCGroupFile(lp, procFd);
- if (hideRunningInContainer && lp->cgroup && isContainerOrVMSlice(lp -> cgroup)) {
- if (!LinuxProcessList_checkPidNamespace(proc, procFd))
+ if (hideRunningInContainer && lp->cgroup && isContainerOrVMSlice(lp->cgroup)) {
+ if (!LinuxProcessList_checkPidNamespace(proc, procFd)) {
goto errorReadingProcess;
+ }
}
}
@@ -1636,7 +1637,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
char statCommand[MAX_NAME + 1];
unsigned long long int lasttimes = (lp->utime + lp->stime);
unsigned long int tty_nr = proc->tty_nr;
- if (! LinuxProcessList_readStatFile(proc, procFd, statCommand, sizeof(statCommand)))
+ if (!LinuxProcessList_readStatFile(proc, procFd, statCommand, sizeof(statCommand)))
goto errorReadingProcess;
if (lp->flags & PF_KTHREAD) {

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