Skip to content

Commit

Permalink
Fix errors from big code import.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Nov 12, 2014
1 parent fb72bf9 commit 36f88d9
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions client/client_shared.c
Expand Up @@ -664,11 +664,15 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)
char err[1024];
int rc;

#ifdef WITH_SRV
if(cfg->use_srv){
rc = mosquitto_connect_srv(mosq, cfg->host, cfg->keepalive, cfg->bind_address);
}else{
rc = mosquitto_connect_bind(mosq, cfg->host, cfg->port, cfg->keepalive, cfg->bind_address);
}
#else
rc = mosquitto_connect_bind(mosq, cfg->host, cfg->port, cfg->keepalive, cfg->bind_address);
#endif
if(rc){
if(!cfg->quiet){
if(rc == MOSQ_ERR_ERRNO){
Expand Down
2 changes: 2 additions & 0 deletions client/client_shared.h
Expand Up @@ -44,7 +44,9 @@ struct mosq_config {
long msglen; /* pub */
char *topic; /* pub */
char *bind_address;
#ifdef WITH_SRV
bool use_srv;
#endif
bool debug;
bool quiet;
unsigned int max_inflight;
Expand Down
2 changes: 1 addition & 1 deletion lib/memory_mosq.h
Expand Up @@ -20,7 +20,7 @@ and the Eclipse Distribution License is available at
#include <stdio.h>
#include <sys/types.h>

#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && !defined(WIN32) && !defined(__SYMBIAN32__)
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && !defined(WIN32) && !defined(__SYMBIAN32__) && !defined(__ANDROID__)
#define REAL_WITH_MEMORY_TRACKING
#endif

Expand Down
2 changes: 1 addition & 1 deletion lib/net_mosq.c
Expand Up @@ -28,7 +28,7 @@ and the Eclipse Distribution License is available at
#include <ws2tcpip.h>
#endif

#ifdef ANDROID
#ifdef __ANDROID__
#include <linux/in.h>
#include <linux/in6.h>
#include <sys/endian.h>
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile
@@ -1,3 +1,5 @@
include ../config.mk

.PHONY: all install uninstall clean reallyclean

ifeq ($(WITH_TLS),yes)
Expand Down
1 change: 1 addition & 0 deletions src/linker-macosx.syms
@@ -0,0 +1 @@
mosquitto_log_printf
3 changes: 3 additions & 0 deletions src/linker.syms
@@ -0,0 +1,3 @@
{
mosquitto_log_printf;
};
2 changes: 1 addition & 1 deletion src/subs.c
Expand Up @@ -654,7 +654,7 @@ static int _retain_search(struct mosquitto_db *db, struct _mosquitto_subhier *su
if(branch->children){
_retain_search(db, branch, tokens, context, sub, sub_qos, level+1);
}
}else if(strcmp(branch->topic, "+") && (!strcmp(branch->topic, tokens->topic) || !strcmp(branch->topic, "+"))){
}else if(strcmp(branch->topic, "+") && (!strcmp(branch->topic, tokens->topic) || !strcmp(tokens->topic, "+"))){
if(tokens->next){
if(_retain_search(db, branch, tokens->next, context, sub, sub_qos, level+1) == -1
|| (!branch->next && tokens->next && !strcmp(tokens->next->topic, "#") && level>0)){
Expand Down
4 changes: 2 additions & 2 deletions src/sys_tree.c
Expand Up @@ -84,7 +84,7 @@ static void _sys_update_clients(struct mosquitto_db *db, char *buf)
}
}

#ifdef WITH_MEMORY_TRACKING
#ifdef REAL_WITH_MEMORY_TRACKING
static void _sys_update_memory(struct mosquitto_db *db, char *buf)
{
static unsigned long current_heap = -1;
Expand Down Expand Up @@ -268,7 +268,7 @@ void mqtt3_db_sys_update(struct mosquitto_db *db, int interval, time_t start_tim
mqtt3_db_messages_easy_queue(db, NULL, "$SYS/broker/retained messages/count", 2, strlen(buf), buf, 1);
}

#ifdef WITH_MEMORY_TRACKING
#ifdef REAL_WITH_MEMORY_TRACKING
_sys_update_memory(db, buf);
#endif

Expand Down

0 comments on commit 36f88d9

Please sign in to comment.