瀏覽代碼

test mytop

master
10195501441 3 年之前
父節點
當前提交
bf8b8a79ec
共有 1 個檔案被更改,包括 8 行新增13 行删除
  1. +8
    -13
      yeeshell.c

+ 8
- 13
yeeshell.c 查看文件

@ -400,22 +400,17 @@ int builtin_history(char **args)
int builtin_mytop()
{
pid_t pid;
int cputimemode = 1;
if ((pid = fork()) < 0)
{
printf("fork error\n");
return -1;
}
getkinfo();
mytop_memory();
get_procs();
if (prev_proc == NULL)
if (pid == 0)
{
int cputimemode = 1;
getkinfo();
mytop_memory();
get_procs();
if (prev_proc == NULL)
get_procs();
print_procs(prev_proc, proc, cputimemode);
exit(1);
}
print_procs(prev_proc, proc, cputimemode);
exit(0);
}
void mytop_memory()

Loading…
取消
儲存