Skip to content

Commit

Permalink
Fix include warnings on some platforms and use PTHREAD_MUTEX_RECURSIV…
Browse files Browse the repository at this point in the history
…E instead of PTHREAD_MUTEX_RECURSIVE_NP
  • Loading branch information
babelouest committed Jan 16, 2018
1 parent 077f922 commit eb93364
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CC=gcc
CFLAGS=-c -pedantic -std=gnu99 -fPIC -Wall -D_REENTRANT -I$(PREFIX)/include -I$(LIBORCANIA_LOCATION) -I$(LIBYDER_LOCATION) $(ADDITIONALFLAGS) $(JANSSONFLAG) $(CURLFLAG) $(WEBSOCKETFLAG)
LIBS=-L$(PREFIX)/lib -L$(LIBORCANIA_LOCATION) -L$(LIBYDER_LOCATION) -lc -lmicrohttpd -lyder -lorcania -lpthread
OUTPUT=libulfius.so
VERSION=2.2.2
VERSION=2.2.3

ifndef JANSSONFLAG
LJANSSON=-ljansson
Expand Down
2 changes: 1 addition & 1 deletion src/u_websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void * ulfius_thread_websocket(void * data) {

if (websocket != NULL && websocket->websocket_manager != NULL) {
pthread_mutexattr_init ( &mutexattr );
pthread_mutexattr_settype( &mutexattr, PTHREAD_MUTEX_RECURSIVE_NP );
pthread_mutexattr_settype( &mutexattr, PTHREAD_MUTEX_RECURSIVE );
if (pthread_mutex_init(&(websocket->websocket_manager->read_lock), &mutexattr) != 0 || pthread_mutex_init(&(websocket->websocket_manager->write_lock), &mutexattr) != 0) {
y_log_message(Y_LOG_LEVEL_ERROR, "Impossible to initialize Mutex Lock for websocket");
websocket->websocket_manager->connected = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/ulfius.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define __ULFIUS_H__

/** External dependencies **/
#include <sys/poll.h>
#include <poll.h>
#include <pthread.h>
#include <microhttpd.h>

Expand Down Expand Up @@ -56,7 +56,7 @@
#define U_ERROR_LIBCURL 5 // Error in libcurl execution
#define U_ERROR_NOT_FOUND 6 // Something was not found

#define ULFIUS_VERSION 2.2.2
#define ULFIUS_VERSION 2.2.3

#define U_CALLBACK_CONTINUE 0
#define U_CALLBACK_COMPLETE 1
Expand Down

0 comments on commit eb93364

Please sign in to comment.