@@ -7,33 +7,33 @@ int main()
7
7
int p ;
8
8
9
9
printf (1 , "--------------Start Testing--------------\n" );
10
- printf (1 , "This is process %d and the parent id is %d\n" , getpid (), getparentid ());
10
+ printf (1 , "This is process %d and the parent id is %d. \n" , getpid (), getparentid ());
11
11
p = fork ();
12
12
13
13
if (p == 0 )
14
14
{
15
15
printf (1 , "----------------Step One----------------\n" );
16
- printf (1 , "This is process %d and the parent id is %d\n" , getpid (), getparentid ());
16
+ printf (1 , "This is process %d and the parent id is %d. \n" , getpid (), getparentid ());
17
17
18
18
p = fork ();
19
19
20
20
if (p == 0 )
21
21
{
22
22
printf (1 , "----------------Step two----------------\n" );
23
- printf (1 , "This is process %d and the parent id is %d\n" , getpid (), getparentid ());
23
+ printf (1 , "This is process %d and the parent id is %d. \n" , getpid (), getparentid ());
24
24
25
25
p = fork ();
26
26
if (p == 0 )
27
27
{
28
- printf (1 , "---------------- Step three- ---------------\n" );
29
- printf (1 , "This is process %d and the parent id is %d\n" , getpid (), getparentid ());
28
+ printf (1 , "---------------Step three---------------\n" );
29
+ printf (1 , "This is process %d and the parent id is %d. \n" , getpid (), getparentid ());
30
30
}
31
31
32
32
wait ();
33
33
}
34
34
wait ();
35
35
}
36
36
wait ();
37
-
37
+ exit ();
38
38
return 0 ;
39
39
}
0 commit comments