|
@ -354,16 +354,7 @@ int built_in(char **args) |
|
|
} |
|
|
} |
|
|
else if (!strcmp(args[0], "mytop")) |
|
|
else if (!strcmp(args[0], "mytop")) |
|
|
{ |
|
|
{ |
|
|
int flag = builtin_mytop(); |
|
|
|
|
|
if (flag == -1) |
|
|
|
|
|
{ |
|
|
|
|
|
printf("yeeshell: unable to get memory info.\n"); |
|
|
|
|
|
} |
|
|
|
|
|
else if (flag == -2) |
|
|
|
|
|
{ |
|
|
|
|
|
printf("yeeshell: unable to get CPU info.\n"); |
|
|
|
|
|
} |
|
|
|
|
|
return flag; |
|
|
|
|
|
|
|
|
return builtin_mytop(); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -549,7 +540,7 @@ void parse_file(pid_t pid) |
|
|
|
|
|
|
|
|
if (slot < 0 || slot >= nr_total) |
|
|
if (slot < 0 || slot >= nr_total) |
|
|
{ |
|
|
{ |
|
|
fprintf(stderr, "top: unreasonable endpoint number %d\n", endpt); |
|
|
|
|
|
|
|
|
//fprintf(stderr, "top: unreasonable endpoint number %d\n", endpt);
|
|
|
fclose(fp); |
|
|
fclose(fp); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|