aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-10-04 10:38:27 -0500
committerMatt Strapp <strap012@umn.edu>2020-10-04 10:38:27 -0500
commit88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04 (patch)
tree75fed135838f24d9de2baed89e9b5c5b43664d9c
parentMerge branch 'master' of github.umn.edu:STRAP012/csci4061Projects (diff)
downloadcsci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar
csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.gz
csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.bz2
csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.lz
csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.xz
csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.tar.zst
csci4061-88f89ffcc45c54cf9bc8e87c7d2fb9a09fa7db04.zip
Fix compiler warnings
-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);
}
}