Skip to content

Commit fd86564

Browse files
committed
Use uid_t type for Process_getuid
1 parent 0806a79 commit fd86564

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ in the source distribution for its full text.
3535
#endif
3636

3737

38-
static int Process_getuid = -1;
38+
static uid_t Process_getuid = (uid_t)-1;
3939

4040
char Process_pidFormat[20] = "%7d ";
4141

@@ -352,7 +352,7 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
352352
case TPGID: xSnprintf(buffer, n, Process_pidFormat, this->tpgid); break;
353353
case TTY_NR: xSnprintf(buffer, n, "%3u:%3u ", major(this->tty_nr), minor(this->tty_nr)); break;
354354
case USER: {
355-
if (Process_getuid != (int) this->st_uid)
355+
if (Process_getuid != this->st_uid)
356356
attr = CRT_colors[PROCESS_SHADOW];
357357
if (this->user) {
358358
xSnprintf(buffer, n, "%-9s ", this->user);
@@ -377,7 +377,7 @@ void Process_display(const Object* cast, RichString* out) {
377377
RichString_prune(out);
378378
for (int i = 0; fields[i]; i++)
379379
As_Process(this)->writeField(this, out, fields[i]);
380-
if (this->settings->shadowOtherUsers && (int)this->st_uid != Process_getuid)
380+
if (this->settings->shadowOtherUsers && this->st_uid != Process_getuid)
381381
RichString_setAttr(out, CRT_colors[PROCESS_SHADOW]);
382382
if (this->tag == true)
383383
RichString_setAttr(out, CRT_colors[PROCESS_TAG]);
@@ -406,7 +406,7 @@ void Process_init(Process* this, const struct Settings_* settings) {
406406
this->show = true;
407407
this->updated = false;
408408
this->basenameOffset = -1;
409-
if (Process_getuid == -1) Process_getuid = getuid();
409+
if (Process_getuid == (uid_t)-1) Process_getuid = getuid();
410410
}
411411

412412
void Process_toggleTag(Process* this) {

0 commit comments

Comments
 (0)