From 61b6b76c349f20bb3d5cf806b14860715dfe121e Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 3 Nov 2020 09:12:27 -0600 Subject: work on it more --- P2/lib/utils.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'P2') diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 22ebfae..39e058f 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -101,11 +101,15 @@ void shuffle(int nMappers, int nReducers) { DIR *dir = opendir(newpath); struct dirent* entry; while ((entry = readdir(dir)) != NULL) { - //message.msgType = hashFunction(/* SOMETHING ,*/ nReducers); - msgsnd(id, &message, chunkSize, 0); - } - } + if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name)) + continue; + + //message.msgType = hashFunction(/* SOMETHING ,*/ nReducers); + msgsnd(id, &message, chunkSize, 0); + } + closedir(dir); + } } // check if the character is valid for a word -- cgit v1.2.3