diff options
author | Andrew Stanley-Jones <andrew.stanley-jones@nokia.com> | 2012-07-02 13:41:00 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-02 05:49:46 +0200 |
commit | 4b30b7e6e2ae2ad13f3566bdc463f319b8456e5e (patch) | |
tree | bf7ff1645a784a6f1cb2659e6a877703bc8bf845 /src/serviceframework | |
parent | 355d9ce74e1ea723cf03a42db1d1ecd9ce9e890b (diff) |
Make unix backend compile on Mac
Update the backend include files and avoid using a linux
only pipe2. Also compile sfwlisten correctly and place
it in the right location.
Change-Id: I083c286a8ed2ca7bdba8f3025c2a66a9e0405a1a
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'src/serviceframework')
-rw-r--r-- | src/serviceframework/ipc/qremoteserviceregister_unix_p.cpp | 10 | ||||
-rw-r--r-- | src/serviceframework/qservicedebuglog.cpp | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/serviceframework/ipc/qremoteserviceregister_unix_p.cpp b/src/serviceframework/ipc/qremoteserviceregister_unix_p.cpp index 762b643b..75654606 100644 --- a/src/serviceframework/ipc/qremoteserviceregister_unix_p.cpp +++ b/src/serviceframework/ipc/qremoteserviceregister_unix_p.cpp @@ -985,7 +985,7 @@ int doStart(const QString &location) { int pipefd[2]; - if (-1 == (pipe2(pipefd, O_CLOEXEC))) { + if (-1 == (pipe(pipefd))) { qWarning("pipe2 failed: %s", ::strerror(errno)); #ifndef Q_OS_MAC ::inotify_rm_watch(fd, wd); @@ -996,6 +996,12 @@ int doStart(const QString &location) { return socketfd; } + flags = fcntl(pipefd[0], F_GETFL, 0); + fcntl(pipefd[0], F_SETFL, flags|O_CLOEXEC); + flags = fcntl(pipefd[1], F_GETFL, 0); + fcntl(pipefd[1], F_SETFL, flags|O_CLOEXEC); + + qint64 pid = 0; // Start the service as a detached process @@ -1018,7 +1024,7 @@ int doStart(const QString &location) { execlp(path.toLatin1(), path.toLatin1(), NULL); - qWarning("exec of process %s failed: %s", path.toLatin1(), ::strerror(errno)); + qWarning() << "exec of process" << path.toLatin1() << ::strerror(errno); qServiceLog() << "class" << "doStart" << "event" << "failed start" diff --git a/src/serviceframework/qservicedebuglog.cpp b/src/serviceframework/qservicedebuglog.cpp index e9cbdf60..30a2b54d 100644 --- a/src/serviceframework/qservicedebuglog.cpp +++ b/src/serviceframework/qservicedebuglog.cpp @@ -48,8 +48,13 @@ #include <QCoreApplication> #include <QFileInfo> +#ifdef QT_SFW_IPC_DEBUG #ifdef Q_OS_UNIX #include <signal.h> +#include <errno.h> +#endif +#include <QNetworkInterface> +#include <QUdpSocket> #endif QT_BEGIN_NAMESPACE |