diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-11-04 17:46:04 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-11-15 18:35:30 +0100 |
commit | 42073babb913497fba58700dc0c5ccdfa7a52b20 (patch) | |
tree | 3d8f054d60b4cc4aa3360d1728c02d4109300ad7 /Process.c | |
parent | 397b5c4bd09115d0df0846fee1b06797b68ae11c (diff) |
Use uid_t type for Process_getuid
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -35,7 +35,7 @@ in the source distribution for its full text. #endif -static int Process_getuid = -1; +static uid_t Process_getuid = (uid_t)-1; char Process_pidFormat[20] = "%7d "; @@ -360,7 +360,7 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field case TPGID: xSnprintf(buffer, n, Process_pidFormat, this->tpgid); break; case TTY_NR: xSnprintf(buffer, n, "%3u:%3u ", major(this->tty_nr), minor(this->tty_nr)); break; case USER: { - if (Process_getuid != (int) this->st_uid) + if (Process_getuid != this->st_uid) attr = CRT_colors[PROCESS_SHADOW]; if (this->user) { xSnprintf(buffer, n, "%-9s ", this->user); @@ -386,7 +386,7 @@ void Process_display(const Object* cast, RichString* out) { for (int i = 0; fields[i]; i++) As_Process(this)->writeField(this, out, fields[i]); - if (this->settings->shadowOtherUsers && (int)this->st_uid != Process_getuid) { + if (this->settings->shadowOtherUsers && this->st_uid != Process_getuid) { RichString_setAttr(out, CRT_colors[PROCESS_SHADOW]); } @@ -420,7 +420,7 @@ void Process_init(Process* this, const struct Settings_* settings) { this->updated = false; this->basenameOffset = -1; - if (Process_getuid == -1) { + if (Process_getuid == (uid_t)-1) { Process_getuid = getuid(); } } |