Browse Source

Finished.

Joshua Rutschmann 8 years ago
parent
commit
ab0321d52b
2 changed files with 1 additions and 3 deletions
  1. 0
    2
      hw5/task1/src/child/mod.rs
  2. 1
    1
      hw5/task1/src/main.rs

+ 0
- 2
hw5/task1/src/child/mod.rs View File

15
 
15
 
16
             if value > 0 {
16
             if value > 0 {
17
                 fork_children(0, value - 1, start_pid);
17
                 fork_children(0, value - 1, start_pid);
18
-            } else {
19
-                return Err("Number of forks must not be zero.".to_string());
20
             }
18
             }
21
 
19
 
22
             Ok(())
20
             Ok(())

+ 1
- 1
hw5/task1/src/main.rs View File

14
     let arguments: Vec<String> = args().collect();
14
     let arguments: Vec<String> = args().collect();
15
 
15
 
16
     if arguments.len() == 2 {
16
     if arguments.len() == 2 {
17
-
18
         let result = child::run_childs(i32::from(getpid()), &arguments[1]);
17
         let result = child::run_childs(i32::from(getpid()), &arguments[1]);
19
         match result {
18
         match result {
20
             Ok(_) => {}
19
             Ok(_) => {}
27
         zombie::run_zombie();
26
         zombie::run_zombie();
28
     } else {
27
     } else {
29
         println!("Bitte nur einen oder zwei Parameter angeben!");
28
         println!("Bitte nur einen oder zwei Parameter angeben!");
29
+        process::exit(1)
30
     }
30
     }
31
 }
31
 }

Loading…
Cancel
Save