mirror of https://github.com/xzeldon/htop.git
Use String_eq wrapper instead of raw strcmp
This commit is contained in:
parent
04cf590967
commit
69efa94f9f
|
@ -434,7 +434,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
|
||||||
|
|
||||||
if (proc->percent_cpu > 0.1) {
|
if (proc->percent_cpu > 0.1) {
|
||||||
// system idle process should own all CPU time left regardless of CPU count
|
// system idle process should own all CPU time left regardless of CPU count
|
||||||
if ( strcmp("idle", kproc->kp_comm) == 0 ) {
|
if (String_eq("idle", kproc->kp_comm)) {
|
||||||
isIdleProcess = true;
|
isIdleProcess = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,7 +303,7 @@ static int valueDigitColor(unsigned int value) {
|
||||||
static void SystemdMeter_display(ATTR_UNUSED const Object* cast, RichString* out) {
|
static void SystemdMeter_display(ATTR_UNUSED const Object* cast, RichString* out) {
|
||||||
char buffer[16];
|
char buffer[16];
|
||||||
|
|
||||||
int color = (systemState && 0 == strcmp(systemState, "running")) ? METER_VALUE_OK : METER_VALUE_ERROR;
|
int color = (systemState && String_eq(systemState, "running")) ? METER_VALUE_OK : METER_VALUE_ERROR;
|
||||||
RichString_writeAscii(out, CRT_colors[color], systemState ? systemState : "N/A");
|
RichString_writeAscii(out, CRT_colors[color], systemState ? systemState : "N/A");
|
||||||
|
|
||||||
RichString_appendAscii(out, CRT_colors[METER_TEXT], " (");
|
RichString_appendAscii(out, CRT_colors[METER_TEXT], " (");
|
||||||
|
|
|
@ -302,7 +302,7 @@ static bool findDevice(const char* name, int* mib, struct sensordev* snsrdev, si
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strcmp(name, snsrdev->xname) == 0) {
|
if (String_eq(name, snsrdev->xname)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ int Platform_getUptime() {
|
||||||
struct utmpx* ent;
|
struct utmpx* ent;
|
||||||
|
|
||||||
while (( ent = getutxent() )) {
|
while (( ent = getutxent() )) {
|
||||||
if ( !strcmp("system boot", ent->ut_line )) {
|
if ( String_eq("system boot", ent->ut_line )) {
|
||||||
boot_time = ent->ut_tv.tv_sec;
|
boot_time = ent->ut_tv.tv_sec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue