Reviewed by Andreas Kling.
[Qt] WebKit does not build on Mac with WebKit 2
https://bugs.webkit.org/show_bug.cgi?id=53380
* Platform/CoreIPC/qt/ConnectionQt.cpp: Use fcntl() to set close on exec so
we do not rely on recent kernel.
(CoreIPC::Connection::readyReadHandler):
* Platform/qt/SharedMemoryQt.cpp: ditto
(WebKit::SharedMemory::create):
(WebKit::SharedMemory::createHandle):
* UIProcess/Launcher/qt/ProcessLauncherQt.cpp: Guard prctl() since it is
a Linux specific function.
(WebKit::QtWebProcess::setupChildProcess):
* UIProcess/DrawingAreaProxy.h: Differentiate between building on Mac
and the Mac port.
* UIProcess/DrawingAreaProxyImpl.cpp: ditto
* UIProcess/WebPageProxy.cpp: ditto
(WebKit::WebPageProxy::didReceiveMessage):
* WebProcess/WebPage/DrawingArea.cpp: ditto
(WebKit::DrawingArea::create):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp: ditto
* WebProcess/WebPage/WebPage.cpp: ditto
(WebKit::WebPage::didReceiveMessage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77765
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-06 Benjamin Poulain <ikipou@gmail.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] WebKit does not build on Mac with WebKit 2
+ https://bugs.webkit.org/show_bug.cgi?id=53380
+
+ * Platform/CoreIPC/qt/ConnectionQt.cpp: Use fcntl() to set close on exec so
+ we do not rely on recent kernel.
+ (CoreIPC::Connection::readyReadHandler):
+ * Platform/qt/SharedMemoryQt.cpp: ditto
+ (WebKit::SharedMemory::create):
+ (WebKit::SharedMemory::createHandle):
+ * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: Guard prctl() since it is
+ a Linux specific function.
+ (WebKit::QtWebProcess::setupChildProcess):
+ * UIProcess/DrawingAreaProxy.h: Differentiate between building on Mac
+ and the Mac port.
+ * UIProcess/DrawingAreaProxyImpl.cpp: ditto
+ * UIProcess/WebPageProxy.cpp: ditto
+ (WebKit::WebPageProxy::didReceiveMessage):
+ * WebProcess/WebPage/DrawingArea.cpp: ditto
+ (WebKit::DrawingArea::create):
+ * WebProcess/WebPage/DrawingArea.h:
+ * WebProcess/WebPage/DrawingAreaImpl.cpp: ditto
+ * WebProcess/WebPage/WebPage.cpp: ditto
+ (WebKit::WebPage::didReceiveMessage):
+
2011-02-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dan Bernstein.
int messageLength = 0;
- while ((messageLength = recvmsg(m_socketDescriptor, &message, MSG_CMSG_CLOEXEC)) == -1) {
+ while ((messageLength = recvmsg(m_socketDescriptor, &message, 0)) == -1) {
if (errno != EINTR)
return;
}
if (messageInfo.isMessageBodyOOL())
attachmentCount--;
+ for (int i = 0; i < attachmentCount; ++i) {
+ while (fcntl(fileDescriptors[i], F_SETFL, FD_CLOEXEC) == -1) {
+ if (errno != EINTR) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+ }
+ }
+
for (int i = 0; i < attachmentCount; ++i)
attachments.append(Attachment(fileDescriptors[i], attachmentSizes[i]));
char* tempNameC = tempNameCSTR.data();
int fileDescriptor;
- while ((fileDescriptor = mkostemp(tempNameC, O_CREAT | O_CLOEXEC | O_RDWR)) == -1) {
+ while ((fileDescriptor = mkstemp(tempNameC)) == -1) {
if (errno != EINTR)
return 0;
}
+ while (fcntl(fileDescriptor, F_SETFD, FD_CLOEXEC) == -1) {
+ if (errno != EINTR) {
+ while (close(fileDescriptor) == -1 && errno == EINTR) { }
+ unlink(tempNameC);
+ return 0;
+ }
+ }
while (ftruncate(fileDescriptor, size) == -1) {
if (errno != EINTR) {
}
}
- while ((fcntl(duplicatedHandle, F_SETFD, O_CLOEXEC | accessModeFile(protection)) == -1)) {
+ while ((fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC | accessModeFile(protection)) == -1)) {
if (errno != EINTR) {
ASSERT_NOT_REACHED();
while (close(duplicatedHandle) == -1 && errno == EINTR) { }
virtual ~DrawingAreaProxy();
-#ifdef __APPLE__
+#if PLATFORM(MAC)
void didReceiveDrawingAreaProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
#endif
#include "WebPageProxy.h"
#include "WebProcessProxy.h"
-#ifndef __APPLE__
+#if !PLATFORM(MAC)
#error "This drawing area is not ready for use by other ports yet."
#endif
#include <wtf/PassRefPtr.h>
#include <wtf/Threading.h>
#include <wtf/text/WTFString.h>
-#if defined Q_OS_UNIX
+#if defined Q_OS_LINUX
#include <sys/prctl.h>
#include <signal.h>
#endif
void QtWebProcess::setupChildProcess()
{
-#if defined Q_OS_UNIX
+#if defined Q_OS_LINUX
prctl(PR_SET_PDEATHSIG, SIGKILL);
#endif
}
void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
-#ifdef __APPLE__
+#if PLATFORM(MAC)
if (messageID.is<CoreIPC::MessageClassDrawingAreaProxy>()) {
m_drawingArea->didReceiveDrawingAreaProxyMessage(connection, messageID, arguments);
return;
// Subclasses
#include "ChunkedUpdateDrawingArea.h"
-#ifdef __APPLE__
+#if PLATFORM(MAC)
#include "DrawingAreaImpl.h"
#endif
break;
case DrawingAreaInfo::Impl:
-#ifdef __APPLE__
+#if PLATFORM(MAC)
return DrawingAreaImpl::create(webPage, parameters);
#else
return 0;
static PassRefPtr<DrawingArea> create(WebPage*, const WebPageCreationParameters&);
virtual ~DrawingArea();
-#ifdef __APPLE__
+#if PLATFORM(MAC)
void didReceiveDrawingAreaMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
#endif
#include "WebProcess.h"
#include <WebCore/GraphicsContext.h>
-#ifndef __APPLE__
+#if !PLATFORM(MAC)
#error "This drawing area is not ready for use by other ports yet."
#endif
return;
}
-#ifdef __APPLE__
+#if PLATFORM(MAC)
if (messageID.is<CoreIPC::MessageClassDrawingArea>()) {
if (m_drawingArea)
m_drawingArea->didReceiveDrawingAreaMessage(connection, messageID, arguments);