From 6bec36dd3805db0147958790bddd67591f7e7165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Fri, 23 May 2014 17:02:01 +0300 Subject: [PATCH 1/2] QDnsLookup: Fix build with uClibc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uClibc doesn't have a nsmap member in __res_state. Since it also doesn't have res_nquery() which is mandatory for QDnsLookup, we can simply disable the code to fix the build. Change-Id: Ia872f535519aca3a2de763548c6dd0e3e0ee20d4 Reviewed-by: Jørgen Lind Reviewed-by: Mandeep Sandhu --- src/network/kernel/qdnslookup_unix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp index 108fcbaf60..8c5a0ebdba 100644 --- a/src/network/kernel/qdnslookup_unix.cpp +++ b/src/network/kernel/qdnslookup_unix.cpp @@ -160,9 +160,11 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN Q_CHECK_PTR(ns); state._u._ext.nsaddrs[0] = ns; } +#ifndef __UCLIBC__ // Set nsmap[] to indicate that nsaddrs[0] is an IPv6 address // See: https://sourceware.org/ml/libc-hacker/2002-05/msg00035.html state._u._ext.nsmap[0] = MAXNS + 1; +#endif state._u._ext.nscount6 = 1; ns->sin6_family = AF_INET6; ns->sin6_port = htons(53); From 7a4dcbaabf037a6913a5662ebb74cc47e04673b9 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 8 Jun 2014 15:39:00 +0200 Subject: [PATCH 2/2] QDBus: fix data race on isDebugging bool Change-Id: Id0b8bf8dac570abfc6c8768bd4264650ae0c199b Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 1fef6d4d49..260c188a41 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -73,8 +73,8 @@ QT_BEGIN_NAMESPACE -static bool isDebugging; -#define qDBusDebug if (!::isDebugging); else qDebug +static QBasicAtomicInt isDebugging = Q_BASIC_ATOMIC_INITIALIZER(-1); +#define qDBusDebug if (::isDebugging == 0); else qDebug Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS))) @@ -1022,13 +1022,12 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) anonymousAuthenticationAllowed(false) { static const bool threads = q_dbus_threads_init_default(); - static const int debugging = qgetenv("QDBUS_DEBUG").toInt(); - ::isDebugging = debugging; + if (::isDebugging == -1) + ::isDebugging = qgetenv("QDBUS_DEBUG").toInt(); Q_UNUSED(threads) - Q_UNUSED(debugging) #ifdef QDBUS_THREAD_DEBUG - if (debugging > 1) + if (::isDebugging > 1) qdbusThreadDebug = qdbusDefaultThreadDebug; #endif