diff options
author | Matt Strapp <strap012@umn.edu> | 2020-10-04 10:37:18 -0500 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2020-10-04 10:37:18 -0500 |
commit | b03806d9ce84300718113a406683d48d6a246b26 (patch) | |
tree | 90be3585e368564aa0777fa2dd4f3182b161e877 /P1/src | |
parent | Add a .vscode because clang was default for some reason (diff) | |
download | csci4061-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.
Diffstat (limited to '')
-rw-r--r-- | P1/src/mapreduce.c | 7 |
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); } } |