DragonFlyBSD: Indentation and formatting fixes

This commit is contained in:
Benny Baumann 2021-05-21 22:42:00 +02:00
parent ee9e7edbc1
commit 2c8353e7cf
1 changed files with 22 additions and 20 deletions

View File

@ -295,6 +295,7 @@ static inline void DragonFlyBSDProcessList_scanJails(DragonFlyBSDProcessList* df
if (sysctlbyname("jail.list", NULL, &len, NULL, 0) == -1) { if (sysctlbyname("jail.list", NULL, &len, NULL, 0) == -1) {
CRT_fatalError("initial sysctlbyname / jail.list failed"); CRT_fatalError("initial sysctlbyname / jail.list failed");
} }
retry: retry:
if (len == 0) if (len == 0)
return; return;
@ -312,11 +313,13 @@ retry:
if (dfpl->jails) { if (dfpl->jails) {
Hashtable_delete(dfpl->jails); Hashtable_delete(dfpl->jails);
} }
dfpl->jails = Hashtable_new(20, true); dfpl->jails = Hashtable_new(20, true);
curpos = jls; curpos = jls;
while (curpos) { while (curpos) {
int jailid; int jailid;
char* str_hostname; char* str_hostname;
nextpos = strchr(curpos, '\n'); nextpos = strchr(curpos, '\n');
if (nextpos) { if (nextpos) {
*nextpos++ = 0; *nextpos++ = 0;
@ -346,6 +349,7 @@ static char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl,
} else { } else {
jname = xStrdup("-"); jname = xStrdup("-");
} }
return jname; return jname;
} }
@ -454,18 +458,18 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
proc->priority = -kproc->kp_lwp.kl_tdprio; proc->priority = -kproc->kp_lwp.kl_tdprio;
switch(kproc->kp_lwp.kl_rtprio.type) { switch(kproc->kp_lwp.kl_rtprio.type) {
case RTP_PRIO_REALTIME: case RTP_PRIO_REALTIME:
proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX + kproc->kp_lwp.kl_rtprio.prio; proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX + kproc->kp_lwp.kl_rtprio.prio;
break; break;
case RTP_PRIO_IDLE: case RTP_PRIO_IDLE:
proc->nice = PRIO_MAX + 1 + kproc->kp_lwp.kl_rtprio.prio; proc->nice = PRIO_MAX + 1 + kproc->kp_lwp.kl_rtprio.prio;
break; break;
case RTP_PRIO_THREAD: case RTP_PRIO_THREAD:
proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX - kproc->kp_lwp.kl_rtprio.prio; proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX - kproc->kp_lwp.kl_rtprio.prio;
break; break;
default: default:
proc->nice = kproc->kp_nice; proc->nice = kproc->kp_nice;
break; break;
} }
// would be nice if we could store multiple states in proc->state (as enum) and have writeField render them // would be nice if we could store multiple states in proc->state (as enum) and have writeField render them
@ -510,23 +514,21 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
default: proc->state = '?'; default: proc->state = '?';
} }
if (kproc->kp_flags & P_SWAPPEDOUT) { if (kproc->kp_flags & P_SWAPPEDOUT)
proc->state = 'W'; proc->state = 'W';
} if (kproc->kp_flags & P_TRACED)
if (kproc->kp_flags & P_TRACED) {
proc->state = 'T'; proc->state = 'T';
} if (kproc->kp_flags & P_JAILED)
if (kproc->kp_flags & P_JAILED) {
proc->state = 'J'; proc->state = 'J';
}
if (Process_isKernelThread(dfp)) { if (Process_isKernelThread(dfp))
super->kernelThreads++; super->kernelThreads++;
}
super->totalTasks++; super->totalTasks++;
if (proc->state == 'R') if (proc->state == 'R')
super->runningTasks++; super->runningTasks++;
proc->updated = true; proc->updated = true;
} }
} }