On 21/11/11 18:02, Adam Stokes wrote:
- Routines added to support running a broker standalone
and in a federation setup.
- Had to use a variant of strtok_r to support windows
You might want to revisit that last sentence ;)
Signed-off-by: Adam Stokes<astokes(a)fedoraproject.org>
---
src/broker/CMakeLists.txt | 4 +---
src/broker/broker_federation.c | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/broker/CMakeLists.txt b/src/broker/CMakeLists.txt
index 07ddbef..bce39ed 100644
--- a/src/broker/CMakeLists.txt
+++ b/src/broker/CMakeLists.txt
@@ -1,11 +1,10 @@
SET(BROKER_DAEMON "matahari-brokerd")
if(WITH-QMF)
-if(NOT WIN32)
OK, but please don't commit this until we actually have a
broker_windows.c in the repo otherwise we will break the build.
add_executable(${BROKER_DAEMON} broker.c broker_federation.c
broker_${VARIANT}.c)
+ target_link_libraries(${BROKER_DAEMON} ${glib_LIBRARIES} mcommon)
if(HAVE_RESOLV_H)
- target_link_libraries(${BROKER_DAEMON} mcommon)
target_link_libraries(${BROKER_DAEMON} resolv)
endif(HAVE_RESOLV_H)
@@ -34,6 +33,5 @@ if(NOT WIN32)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/matahari-broker.service DESTINATION
${systemdunitdir})
endif(systemd_FOUND)
-endif(NOT WIN32)
endif(WITH-QMF)
diff --git a/src/broker/broker_federation.c b/src/broker/broker_federation.c
index 173f437..27156a1 100644
--- a/src/broker/broker_federation.c
+++ b/src/broker/broker_federation.c
@@ -133,7 +133,7 @@ broker_federation_configure(void)
mh_string_copy(peers, brokers, sizeof(peers));
- while ((peer = strtok_r(p ? NULL : peers, ",; ",&p)) != NULL) {
+ while ((peer = strtok(peers, ",; ")) != NULL) {
This line should be:
+ while ((peer = strtok(peer ? NULL : peers, ",; ")) != NULL) {
(and peer now needs to be initialised to NULL for this to work.)
Please also remove the definition of p, since it is now unused.
if (IS_DNS_SRV(peer, TCP) || IS_DNS_SRV(peer, TLS)) {
peer = broker_lookup(peer);
}
cheers,
Zane.