瀏覽代碼

Updated readproc.rs. Not complete yet

Lorenz Bung 8 年之前
父節點
當前提交
37744d4484
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      hw4/task1/src/readproc.rs

+ 3
- 3
hw4/task1/src/readproc.rs 查看文件

@@ -15,7 +15,7 @@ pub fn get_pid_command(pid: i32) -> Result<String, &'static str> {
15 15
     }
16 16
 }
17 17
 
18
-/*pub fn get_last_created_command() -> Result<String, &'static str> {
18
+pub fn get_last_created_command() -> Result<String, &'static str> {
19 19
     match loadavg() {
20 20
         Ok(stat) => {
21 21
             let last_pid = stat.last_created_pid;
@@ -24,9 +24,9 @@ pub fn get_pid_command(pid: i32) -> Result<String, &'static str> {
24 24
                 Err(_) => { Err("No last command via PID found") }
25 25
             }
26 26
         }
27
-        Err(_) => { Err("No last command via PID found") }
27
+        Err(_) => { Err("No last command found") }
28 28
     }
29
-}*/
29
+}
30 30
 
31 31
 pub fn get_thread_count(pid: i32) -> Result<u32, &'static str> {
32 32
     match pid::stat(pid) {

Loading…
取消
儲存