aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--P1/src/mapreduce.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/P1/src/mapreduce.c b/P1/src/mapreduce.c
index 6a882bc..d6094ac 100644
--- a/P1/src/mapreduce.c
+++ b/P1/src/mapreduce.c
@@ -55,10 +55,13 @@ int main(int argc, char *argv[]) {
pid_t reducerPid;
for (int i = 0; i < nReducers; i++) {
+ if (pid == 0)
reducerPid = fork();
if (reducerPid > 0) {
- //TODO: exec here
- execl("./reducer", "./reducer", i, NULL);
+ //TODO: exec here
+ char* num[10];
+ sprintf(&num, "%d", i);
+ execl("./reducer", "./reducer", &num, NULL);
}
}