summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-05-11 11:17:22 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-11 11:17:22 (GMT)
commit97447d569999372d43f22dbb1e0fc5193b73615c (patch)
tree5b1fb557d6356e4eebe5045009eaa0c4c2138dea /src/corelib
parenteabcaaa9be03674d45e6bb53e098d5b5b3e9ef81 (diff)
parent1a742a039802b32cfe2a92d8ef1a04c3a21a964f (diff)
downloadQt-97447d569999372d43f22dbb1e0fc5193b73615c.zip
Qt-97447d569999372d43f22dbb1e0fc5193b73615c.tar.gz
Qt-97447d569999372d43f22dbb1e0fc5193b73615c.tar.bz2
Merge remote-tracking branch 'origin/4.8' into qt-4.8-from-4.7
Conflicts: src/network/access/qhttpnetworkconnectionchannel.cpp src/network/socket/qabstractsocket.cpp tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp2
-rw-r--r--src/corelib/io/qprocess_symbian.cpp5
-rw-r--r--src/corelib/io/qprocess_unix.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp6
-rw-r--r--src/corelib/thread/qmutex_unix.cpp13
5 files changed, 22 insertions, 9 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 742b05e..030b845 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -639,7 +639,7 @@ QFileSystemEntry QFileSystemEngine::currentPath()
#if defined(__GLIBC__) && !defined(PATH_MAX)
char *currentName = ::get_current_dir_name();
if (currentName) {
- result = QFile::decodeName(QByteArray(currentName));
+ result = QFileSystemEntry(QByteArray(currentName), QFileSystemEntry::FromNativePath());
::free(currentName);
}
#else
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index 8a74c7b..2ce7a00 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -1062,6 +1062,11 @@ void QProcessPrivate::initializeProcessManager()
(void) processManager();
}
+QProcessEnvironment QProcessEnvironment::systemEnvironment()
+{
+ return QProcessEnvironment();
+}
+
QT_END_NAMESPACE
#endif // QT_NO_PROCESS
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index a3c589f..5616d39 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -457,9 +457,6 @@ QT_BEGIN_INCLUDE_NAMESPACE
#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
-#elif defined(Q_OS_SYMBIAN) || (defined(Q_OS_MAC) && defined(QT_NO_CORESERVICES))
- static char *qt_empty_environ[] = { 0 };
-#define environ qt_empty_environ
#else
extern char **environ;
#endif
@@ -468,6 +465,7 @@ QT_END_INCLUDE_NAMESPACE
QProcessEnvironment QProcessEnvironment::systemEnvironment()
{
QProcessEnvironment env;
+#if !defined(Q_OS_MAC) || !defined(QT_NO_CORESERVICES)
const char *entry;
for (int count = 0; (entry = environ[count]); ++count) {
const char *equal = strchr(entry, '=');
@@ -479,6 +477,7 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment()
env.d->hash.insert(QProcessEnvironmentPrivate::Key(name),
QProcessEnvironmentPrivate::Value(value));
}
+#endif
return env;
}
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index e0eeb08..bd12726 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -1111,6 +1111,12 @@ bool QEventDispatcherSymbian::hasPendingEvents()
void QEventDispatcherSymbian::registerSocketNotifier ( QSocketNotifier * notifier )
{
+ //check socket descriptor is usable
+ if (notifier->socket() >= FD_SETSIZE || notifier->socket() < 0) {
+ //same warning message as the unix event dispatcher for easy testing
+ qWarning("QSocketNotifier: Internal error");
+ return;
+ }
//note - this is only for "open C" file descriptors
//for native sockets, an active object in the symbian socket engine handles this
QSocketActiveObject *socketAO = new QSocketActiveObject(this, notifier);
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index 11e2060..b584ae5 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -107,18 +107,21 @@ bool QMutexPrivate::wait(int timeout)
// lock acquired without waiting
return true;
}
- bool returnValue;
+ kern_return_t r;
if (timeout < 0) {
- returnValue = semaphore_wait(mach_semaphore) == KERN_SUCCESS;
+ do {
+ r = semaphore_wait(mach_semaphore);
+ } while (r == KERN_ABORTED);
+ if (r != KERN_SUCCESS)
+ qWarning("QMutex: infinite wait failed, error %d", r);
} else {
mach_timespec_t ts;
ts.tv_nsec = ((timeout % 1000) * 1000) * 1000;
ts.tv_sec = (timeout / 1000);
- kern_return_t r = semaphore_timedwait(mach_semaphore, ts);
- returnValue = r == KERN_SUCCESS;
+ r = semaphore_timedwait(mach_semaphore, ts);
}
contenders.deref();
- return returnValue;
+ return r == KERN_SUCCESS;
}
void QMutexPrivate::wakeUp()