Skip to content

Commit

Permalink
Merge branch 'HomePortRefactored' of https://github.com/home-port/Hom…
Browse files Browse the repository at this point in the history
…ePort into HomePortRefactored
  • Loading branch information
Thomas Pedersen committed Oct 24, 2014
2 parents ea2f8af + bbd2b1f commit ef3093d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@
cmake_minimum_required(VERSION 2.6)
project(HOMEPORT C)

set(CMAKE_C_FLAGS "-DHPD_HTTP -DLR_ORIGIN")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DDEBUG -Wall")

# -fPIC is for compiling on 64bit
set(CMAKE_C_FLAGS_DEBUG "-fPIC -g -DDEBUG -DHPD_HTTP -DLR_ORIGIN -Wall")
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-fPIC ${CMAKE_C_FLAGS_DEBUG}")
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

set(CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
include(CTest)
Expand Down
6 changes: 4 additions & 2 deletions OperationHandler/homeport/src/homeport.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ homePortEasy( int (*init)(HomePort *homeport, void *data), void (*deinit)(HomePo
ev_signal_start(loop, &sigterm_watcher);

// Call init
if ((rc = init(homeport, data))) return rc;
if (init)
if ((rc = init(homeport, data))) return rc;

if( ( rc = homePortStart(homeport) ) ) return rc;

Expand Down Expand Up @@ -452,7 +453,8 @@ sig_cb ( struct ev_loop *loop, struct ev_signal *w, int revents )
// TODO Might be a problem that deinit is not called on ws_stop, but
// only if the server is stopped by a signal. Note that this is only
// used in HPD_easy way of starting the server.
deinit(homeport, ((void **)w->data)[2]);
if (deinit)
deinit(homeport, ((void **)w->data)[2]);


// Stop server and loop
Expand Down
2 changes: 2 additions & 0 deletions misc/src/linkedmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ char* lm_find_n(struct lm *map, const char* key, size_t key_len)

if(map){
for(it = ll_head(map->pairs); it != NULL; it = ll_next(it)) {
if(strlen(((struct pair*)ll_data(it))->key) == key_len){
if(strncmp(((struct pair*)ll_data(it))->key, key, key_len) == 0) {
return ((struct pair*)ll_data(it))->value;
}
}
}
}
return NULL;
Expand Down

0 comments on commit ef3093d

Please sign in to comment.