Added volatile keyword

This commit is contained in:
2022-07-03 23:02:53 -05:00
parent 8ecd79ff40
commit 23be8915d6
4 changed files with 4 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ static int *pending;
static Sitefile *site;
static int mainfd; /* fd of the UNIX socket */
static struct sockaddr_un addr;
static ConnInfo *conninfo;
static volatile ConnInfo *conninfo;
/* We want to be able to handle a signal at any time, so some global variables
* are needed. */
static const int signals[] = {

View File

@@ -32,7 +32,7 @@
#include <swebs/connections.h>
void runServer(int connfd, Sitefile *site, int *pending, int id,
ConnInfo *conninfo) {
volatile ConnInfo *conninfo) {
int allocConns = 100;
struct pollfd *fds;
Connection *connections;

View File

@@ -29,7 +29,7 @@ typedef struct {
} ConnInfo;
void runServer(int connfd, Sitefile *site, int *pending, int id,
ConnInfo *info);
volatile ConnInfo *info);
/* pending and info are shared memory. pending[id] is the amount of connections
* that are being processed by that process, and info contains info about the
* connection being sent through. */