Commits

Roger Light  committed d1fed7f

Fix compilation for WITH_THREADING=no.

Thanks to David Reid.

  • Participants
  • Parent commits 1553d82
  • Branches 1.3.1

Comments (0)

Files changed (2)

File ChangeLog.txt

 
 Client library:
 - Fix socketpair code on the Mac.
+- Fix compilation for WITH_THREADING=no.
 
 Clients:
 - Fix keepalive value on mosquitto_pub.

File lib/messages_mosq.c

 	}
 }
 
+#ifdef WITH_THREADING
 void _mosquitto_message_retry_check_actual(struct mosquitto *mosq, struct mosquitto_message_all *messages, pthread_mutex_t mutex)
+#else
+void _mosquitto_message_retry_check_actual(struct mosquitto *mosq, struct mosquitto_message_all *messages)
+#endif
 {
 	time_t now = mosquitto_time();
 	assert(mosq);
 
+#ifdef WITH_THREADING
 	pthread_mutex_lock(&mutex);
+#endif
 
 	while(messages){
 		if(messages->timestamp + mosq->message_retry < now){
 		}
 		messages = messages->next;
 	}
+#ifdef WITH_THREADING
 	pthread_mutex_unlock(&mutex);
+#endif
 }
 
 void _mosquitto_message_retry_check(struct mosquitto *mosq)
 {
+#ifdef WITH_THREADING
 	_mosquitto_message_retry_check_actual(mosq, mosq->out_messages, mosq->out_message_mutex);
 	_mosquitto_message_retry_check_actual(mosq, mosq->in_messages, mosq->in_message_mutex);
+#else
+	_mosquitto_message_retry_check_actual(mosq, mosq->out_messages);
+	_mosquitto_message_retry_check_actual(mosq, mosq->in_messages);
+#endif
 }
 
 void mosquitto_message_retry_set(struct mosquitto *mosq, unsigned int message_retry)