Sfoglia il codice sorgente

Final clean-up. Final Comments.

themultiplexer 8 anni fa
parent
commit
e41417cdba
3 ha cambiato i file con 4 aggiunte e 9 eliminazioni
  1. 1
    1
      hw4/task1/Cargo.toml
  2. 1
    5
      hw4/task1/src/main.rs
  3. 2
    3
      hw4/task1/src/pstree.rs

+ 1
- 1
hw4/task1/Cargo.toml Vedi File

@@ -5,4 +5,4 @@ authors = ["Lorenz Bung & Joshua Rutschmann"]
5 5
 
6 6
 [dependencies]
7 7
 procinfo = "^0.4.2"
8
-libc = "^0.2"
8
+libc = "^0.2"

+ 1
- 5
hw4/task1/src/main.rs Vedi File

@@ -9,6 +9,7 @@ mod pstree;
9 9
 mod unit_test_pstree;
10 10
 mod unit_test_readproc;
11 11
 
12
+/// Mainfunction
12 13
 fn main() {
13 14
 
14 15
     let args:Vec<String> = env::args().collect();
@@ -76,9 +77,4 @@ fn main() {
76 77
             process::exit(1);
77 78
         }
78 79
     }
79
-
80
-
81
-
82
-
83
-
84 80
 }

+ 2
- 3
hw4/task1/src/pstree.rs Vedi File

@@ -21,6 +21,7 @@ impl Process {
21 21
         }
22 22
     }
23 23
 
24
+    /// Erstellt eine Prozess-Datenstruktur aus procinfo::Stat.
24 25
     pub fn me() -> Self {
25 26
         if let Ok(my_pid) = pid::stat_self() {
26 27
             Process::new(my_pid.pid)
@@ -67,9 +68,8 @@ impl Process {
67 68
     }
68 69
 }
69 70
 
70
-/// Erstellt einen 'Process' aus der übergebenen PID und gibt die Prozesskette
71
+/// Geht von eigenem Prozess aus und gibt die Prozesskette bis zum übergebenem PID aus
71 72
 /// und fängt mögliche Fehler ab.
72
-///
73 73
 pub fn print(pid:pid_t) -> bool {
74 74
 
75 75
     if let Err(_) = pid::stat(pid) {
@@ -77,7 +77,6 @@ pub fn print(pid:pid_t) -> bool {
77 77
         return false
78 78
     }
79 79
 
80
-
81 80
     let my_proc = Process::me();
82 81
 
83 82
     if !my_proc.has_parent_with_pid(pid) {

Loading…
Annulla
Salva