aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-10-04 10:37:18 -0500
committerMatt Strapp <strap012@umn.edu>2020-10-04 10:37:18 -0500
commitb03806d9ce84300718113a406683d48d6a246b26 (patch)
tree90be3585e368564aa0777fa2dd4f3182b161e877
parentAdd a .vscode because clang was default for some reason (diff)
downloadcsci4061-b03806d9ce84300718113a406683d48d6a246b26.tar
csci4061-b03806d9ce84300718113a406683d48d6a246b26.tar.gz
csci4061-b03806d9ce84300718113a406683d48d6a246b26.tar.bz2
csci4061-b03806d9ce84300718113a406683d48d6a246b26.tar.lz
csci4061-b03806d9ce84300718113a406683d48d6a246b26.tar.xz
csci4061-b03806d9ce84300718113a406683d48d6a246b26.tar.zst
csci4061-b03806d9ce84300718113a406683d48d6a246b26.zip
Help. It's broken.
-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);
}
}