Rewrite process existence check for readability
This commit is contained in:
		
							parent
							
								
									097a93441b
								
							
						
					
					
						commit
						007c2d3ccf
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -823,7 +823,7 @@ void check_idle() | ||||||
|     struct stat status; |     struct stat status; | ||||||
|     time_t idle, sesstime; |     time_t idle, sesstime; | ||||||
| 
 | 
 | ||||||
|     if (utmpp->ut_type != USER_PROCESS || kill(utmpp->ut_pid, 0)) /* if not user process, or if proc doesn't exist */ |     if (utmpp->ut_type != USER_PROCESS || kill(utmpp->ut_pid, 0) == -1) /* if not user process, or if proc doesn't exist */ | ||||||
|         return;                 /* skip the utmp entry */ |         return;                 /* skip the utmp entry */ | ||||||
|     strncpy(user, utmpp->ut_user, sizeof(user) - 1);    /* get user name */ |     strncpy(user, utmpp->ut_user, sizeof(user) - 1);    /* get user name */ | ||||||
|     user[sizeof(user) - 1] = '\0';      /* null terminate user name string */ |     user[sizeof(user) - 1] = '\0';      /* null terminate user name string */ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Petar Kapris
						Petar Kapris