mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Change more fprintf(stderr, ...); exit(...); to err[x](...). Tweak a few existing ones and fix some style.
This commit is contained in:
7
htop.c
7
htop.c
@ -132,11 +132,11 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
|
||||
char* saveptr;
|
||||
char* pid = strtok_r(argCopy, ",", &saveptr);
|
||||
|
||||
if( !flags.pidWhiteList ) {
|
||||
if(!flags.pidWhiteList) {
|
||||
flags.pidWhiteList = Hashtable_new(8, false);
|
||||
}
|
||||
|
||||
while( pid ) {
|
||||
while(pid) {
|
||||
unsigned int num_pid = atoi(pid);
|
||||
Hashtable_put(flags.pidWhiteList, num_pid, (void *) 1);
|
||||
pid = strtok_r(NULL, ",", &saveptr);
|
||||
@ -176,8 +176,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
#ifdef HAVE_PROC
|
||||
if (access(PROCDIR, R_OK) != 0) {
|
||||
fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR);
|
||||
exit(1);
|
||||
errx(1, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user