diff options
-rw-r--r-- | P2/lib/utils.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c index f1c2472..788a128 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -28,9 +28,16 @@ char *getChunkData(int mapperID) { if (strncmp("END", message.msgText, 4) == 0) return NULL; char* value = message.msgText; + return value; + + // DEBUG! malloc a buffer/return + // char* value = malloc(1024); // chunkSize or MSGSIZE? + // return value; + // Free memory + // printf("%s\n", message.msgText); //printf("RECEIVED CHUNK:%s\nRECEIVED VALUE:%ld\n", value, message.msgType); - return value; + //return &(message.msgText); } @@ -39,6 +46,7 @@ void sendChunkData(char *inputFile, int nMappers) { struct msgBuffer message = makeMessage(); // open message queue int msgid = openQueue(); + // DEBUG! Remove if already exists when opening queue for the first time int map = 0; FILE* file = fopen(inputFile, "r"); // construct chunks of 1024 bytes |