From 16e534fdc30615864bf3a60943a9daa417ea5cb1 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 27 Oct 2020 14:07:56 -0500 Subject: Fix arrangment + comment --- P2/include/utils.h | 1 + P2/lib/utils.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'P2') diff --git a/P2/include/utils.h b/P2/include/utils.h index c4d2eb4..050a0e3 100644 --- a/P2/include/utils.h +++ b/P2/include/utils.h @@ -22,6 +22,7 @@ struct msgBuffer { char msgText[MSGSIZE]; }; //Open Queue as a function because writing this once is probably better than four times. +//Hopefully it works properly. int openQueue(); // mapper side diff --git a/P2/lib/utils.c b/P2/lib/utils.c index 6fa454e..ea2ed3d 100644 --- a/P2/lib/utils.c +++ b/P2/lib/utils.c @@ -1,8 +1,7 @@ #include "utils.h" int openQueue() { - key_t Qkey = ftok("4061 Project 2 SS", 'S'); - int id = msgget(Qkey, 0666 | IPC_CREAT); + int id = msgget(ftok("4061 Project 2 SS", 'S'), 0666 | IPC_CREAT); if (id < 0) { perror("Cannot open queue.\n"); -- cgit v1.2.3