diff --git a/Makefile b/Makefile index d05cb72..572a0a1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SRC = $(wildcard src/*.c) OBJ = $(subst .c,.o,$(subst src,work,$(SRC))) LIBS = gnutls LDFLAGS = -pie -lrt -ldl $(shell pkg-config --libs $(LIBS)) -CFLAGS := -O2 -pipe -Wall -Wpedantic -Wshadow -ansi -D_XOPEN_SOURCE=500 -ggdb +CFLAGS := -O2 -pipe -Wall -Wpedantic -Wshadow -ansi -D_XOPEN_SOURCE=500 CFLAGS += -Isrc/ -fpie -D_POSIX_C_SOURCE=200809L $(shell pkg-config --cflags $(LIBS)) INSTALLDIR := /usr/sbin HEADERDIR := /usr/include/ diff --git a/src/main.c b/src/main.c index 3d67b9e..c1a1590 100644 --- a/src/main.c +++ b/src/main.c @@ -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[] = { diff --git a/src/runner.c b/src/runner.c index c038290..a1d857c 100644 --- a/src/runner.c +++ b/src/runner.c @@ -32,7 +32,7 @@ #include void runServer(int connfd, Sitefile *site, int *pending, int id, - ConnInfo *conninfo) { + volatile ConnInfo *conninfo) { int allocConns = 100; struct pollfd *fds; Connection *connections; diff --git a/src/swebs/runner.h b/src/swebs/runner.h index 9a7b2cc..64ac845 100644 --- a/src/swebs/runner.h +++ b/src/swebs/runner.h @@ -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. */