Commit ee76567d authored by Taddeüs Kroes's avatar Taddeüs Kroes

- Worked on OS ass3.

parent 0cb7be9e
...@@ -131,7 +131,7 @@ main(int argc, char * argv[]) ...@@ -131,7 +131,7 @@ main(int argc, char * argv[])
if( pipe(pipe_id) ) if( pipe(pipe_id) )
{ {
fprintf(stderr, "Error %d occured while createing the pipe \n", errno); fprintf(stderr, "Error %d occured while creating the pipe \n", errno);
exit(1); exit(1);
} }
...@@ -168,10 +168,6 @@ main(int argc, char * argv[]) ...@@ -168,10 +168,6 @@ main(int argc, char * argv[])
{ {
break; break;
} }
else if( c == 'P' )
{
wait(NULL);
}
else if( c != 'f' ) else if( c != 'f' )
{ {
if( write(pipe_id[1], &c, 1) != 1 ) if( write(pipe_id[1], &c, 1) != 1 )
...@@ -182,7 +178,10 @@ main(int argc, char * argv[]) ...@@ -182,7 +178,10 @@ main(int argc, char * argv[])
} }
else else
{ {
pid_t child_id; if( c == 'P' )
wait(NULL);
pid_t child_id;
kiddoCount++; kiddoCount++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment