summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--main.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5b221a9..a6f7b1a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
CC = gcc
-CFLAGS = -Wall -Wextra -std=c11 -fwrapv -fPIC
+CFLAGS = -Wall -Wextra -std=c11 -fwrapv -fPIC -pthread
ifneq ($(DEBUG),)
CFLAGS += -g
else
CFLAGS += -O2
endif
-LDFLAGS = -ldl
+LDFLAGS = -ldl -pthread
BIN = cserver
PLUGINDIR = plugins
diff --git a/main.c b/main.c
index debaa3e..d38b141 100644
--- a/main.c
+++ b/main.c
@@ -5,6 +5,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <stdint.h>
#include <unistd.h>
#include <dlfcn.h>
#include <errno.h>
@@ -65,7 +66,7 @@ static void load_plugin(const char *name){
static void* thread_entry_connection_handler(void *sock_){
- int sock=(int)sock_;
+ int sock=(int)(uintptr_t)sock_;
Headers *headers=http_get_headers(sock);
if(headers==NULL){