Skip to content

Commit

Permalink
Fixed smuos#6 Parent process should print the results of mean()
Browse files Browse the repository at this point in the history
  • Loading branch information
LYC1929 committed Sep 30, 2014
1 parent 6bd6d34 commit ba30515
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,14 @@ int main(int argc, char *argv[]) {
// Child call median()
double child = median(pt, length);
// Child process should print the results of median()
fprintf(stdout, "This is child processing (pid:%d)\n ", (int)getpid());
fprintf(stdout, "This is child processing (pid:%d)\n", (int)getpid());
fprintf(stdout, "The median value is %d\n", child);
} else if (rc == 1) {
// Parent call mean()
double parent = mean(pt, length);
// Parent process should print the results of mean()
fprintf(stdout,"This is parent processing (pid:%d)\n", (int)getpid());
fprintf(stdout, "The mean value is %d\n", parent);
}

return 0;
Expand Down

0 comments on commit ba30515

Please sign in to comment.