@@ -35,7 +35,7 @@ in the source distribution for its full text.
35
35
#endif
36
36
37
37
38
- static int Process_getuid = -1 ;
38
+ static uid_t Process_getuid = ( uid_t ) - 1 ;
39
39
40
40
char Process_pidFormat [20 ] = "%7d " ;
41
41
@@ -352,7 +352,7 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
352
352
case TPGID : xSnprintf (buffer , n , Process_pidFormat , this -> tpgid ); break ;
353
353
case TTY_NR : xSnprintf (buffer , n , "%3u:%3u " , major (this -> tty_nr ), minor (this -> tty_nr )); break ;
354
354
case USER : {
355
- if (Process_getuid != ( int ) this -> st_uid )
355
+ if (Process_getuid != this -> st_uid )
356
356
attr = CRT_colors [PROCESS_SHADOW ];
357
357
if (this -> user ) {
358
358
xSnprintf (buffer , n , "%-9s " , this -> user );
@@ -377,7 +377,7 @@ void Process_display(const Object* cast, RichString* out) {
377
377
RichString_prune (out );
378
378
for (int i = 0 ; fields [i ]; i ++ )
379
379
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 )
381
381
RichString_setAttr (out , CRT_colors [PROCESS_SHADOW ]);
382
382
if (this -> tag == true)
383
383
RichString_setAttr (out , CRT_colors [PROCESS_TAG ]);
@@ -406,7 +406,7 @@ void Process_init(Process* this, const struct Settings_* settings) {
406
406
this -> show = true;
407
407
this -> updated = false;
408
408
this -> basenameOffset = -1 ;
409
- if (Process_getuid == -1 ) Process_getuid = getuid ();
409
+ if (Process_getuid == ( uid_t ) - 1 ) Process_getuid = getuid ();
410
410
}
411
411
412
412
void Process_toggleTag (Process * this ) {
0 commit comments