aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--P1/src/mapreduce.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/P1/src/mapreduce.c b/P1/src/mapreduce.c
index d6094ac..9fad791 100644
--- a/P1/src/mapreduce.c
+++ b/P1/src/mapreduce.c
@@ -31,7 +31,9 @@ int main(int argc, char *argv[]) {
mapperPid = fork();
if (mapperPid > 0) {
//TODO: exec here
- execl("./mapper", "./mapper", i, NULL);
+ char num[10];
+ sprintf(num, "%d", i);
+ execl("./mapper", "./mapper", num, NULL);
}
}
@@ -59,8 +61,8 @@ int main(int argc, char *argv[]) {
reducerPid = fork();
if (reducerPid > 0) {
//TODO: exec here
- char* num[10];
- sprintf(&num, "%d", i);
+ char num[10];
+ sprintf(num, "%d", i);
execl("./reducer", "./reducer", &num, NULL);
}
}