<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[151825] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/151825">151825</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-06-20 23:02:58 -0700 (Thu, 20 Jun 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WK2] Looping for EINTR on close() is incorrect for Linux, at least
https://bugs.webkit.org/show_bug.cgi?id=117266

Patch by Sergio Correia &lt;sergio.correia@openbossa.org&gt; on 2013-06-20
Reviewed by Darin Adler.

Source/WebKit2:

Call closeWithRetry() to work around a difference in how the retry needs to
be done on Linux.

* Platform/CoreIPC/unix/AttachmentUnix.cpp:
(CoreIPC::Attachment::dispose):
* Platform/CoreIPC/unix/ConnectionUnix.cpp:
(CoreIPC::Connection::platformInvalidate):
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::Handle::~Handle):
(WebKit::SharedMemory::create):
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):
* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::createWebProcessConnection):
* SharedWorkerProcess/SharedWorkerProcess.cpp:
(WebKit::SharedWorkerProcess::createWebProcessConnection):
* UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
(WebKit::ProcessLauncher::launchProcess): All these places had
``close-followed-by-EINTR-handling'' replaced with the new closeWithRetry()
function added in this commit.

Source/WTF:

Added file UniStdExtras with a closeWithRetry() function that works around
the EINTR behavior on Linux during a close() call: it closes the descriptor
unconditionally even when the call is interrupted.

* wtf/UniStdExtras.h: Added.
(WTF::closeWithRetry): Wrapper around POSIX close() that handles EINTR
correctly.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformCoreIPCunixAttachmentUnixcpp">trunk/Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformCoreIPCunixConnectionUnixcpp">trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformunixSharedMemoryUnixcpp">trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp</a></li>
<li><a href="#trunkSourceWebKit2PluginProcessPluginProcesscpp">trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWorkerProcessSharedWorkerProcesscpp">trunk/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessLauncherqtProcessLauncherQtcpp">trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfUniStdExtrash">trunk/Source/WTF/wtf/UniStdExtras.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WTF/ChangeLog        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2013-06-20  Sergio Correia  &lt;sergio.correia@openbossa.org&gt;
+
+        [WK2] Looping for EINTR on close() is incorrect for Linux, at least
+        https://bugs.webkit.org/show_bug.cgi?id=117266
+
+        Reviewed by Darin Adler.
+
+        Added file UniStdExtras with a closeWithRetry() function that works around
+        the EINTR behavior on Linux during a close() call: it closes the descriptor
+        unconditionally even when the call is interrupted.
+
+        * wtf/UniStdExtras.h: Added.
+        (WTF::closeWithRetry): Wrapper around POSIX close() that handles EINTR
+        correctly.
+
</ins><span class="cx"> 2013-06-20  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refine the StackBounds computation for Windows.
</span></span></pre></div>
<a id="trunkSourceWTFwtfUniStdExtrash"></a>
<div class="addfile"><h4>Added: trunk/Source/WTF/wtf/UniStdExtras.h (0 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/UniStdExtras.h                                (rev 0)
+++ trunk/Source/WTF/wtf/UniStdExtras.h        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UniStdExtras_h
+#define UniStdExtras_h
+
+#include &lt;errno.h&gt;
+#include &lt;unistd.h&gt;
+
+namespace WTF {
+
+inline int closeWithRetry(int fileDescriptor)
+{
+    int ret;
+#if OS(LINUX)
+    // Workaround for the Linux behavior of closing the descriptor
+    // unconditionally, even if the close() call is interrupted.
+    // See https://bugs.webkit.org/show_bug.cgi?id=117266 for more
+    // details.
+    if ((ret = close(fileDescriptor)) == -1 &amp;&amp; errno == EINTR)
+        return 0;
+#else
+    while ((ret = close(fileDescriptor)) == -1 &amp;&amp; errno == EINTR) { }
+#endif
+    return ret;
+}
+
+} // namespace WTF
+
+using WTF::closeWithRetry;
+
+#endif // UniStdExtras_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/ChangeLog        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2013-06-20  Sergio Correia  &lt;sergio.correia@openbossa.org&gt;
+
+        [WK2] Looping for EINTR on close() is incorrect for Linux, at least
+        https://bugs.webkit.org/show_bug.cgi?id=117266
+
+        Reviewed by Darin Adler.
+
+        Call closeWithRetry() to work around a difference in how the retry needs to
+        be done on Linux.
+
+        * Platform/CoreIPC/unix/AttachmentUnix.cpp:
+        (CoreIPC::Attachment::dispose):
+        * Platform/CoreIPC/unix/ConnectionUnix.cpp:
+        (CoreIPC::Connection::platformInvalidate):
+        * Platform/unix/SharedMemoryUnix.cpp:
+        (WebKit::SharedMemory::Handle::~Handle):
+        (WebKit::SharedMemory::create):
+        (WebKit::SharedMemory::~SharedMemory):
+        (WebKit::SharedMemory::createHandle):
+        * PluginProcess/PluginProcess.cpp:
+        (WebKit::PluginProcess::createWebProcessConnection):
+        * SharedWorkerProcess/SharedWorkerProcess.cpp:
+        (WebKit::SharedWorkerProcess::createWebProcessConnection):
+        * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
+        (WebKit::ProcessLauncher::launchProcess): All these places had
+        ``close-followed-by-EINTR-handling'' replaced with the new closeWithRetry()
+        function added in this commit.
+
</ins><span class="cx"> 2013-06-20  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebProcess hangs loading eff.org (Waiting forever on a sync XHR, NetworkProcess unable to service it).
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformCoreIPCunixAttachmentUnixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -27,8 +27,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;Attachment.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;unistd.h&gt;
-#include &lt;errno.h&gt;
</del><ins>+#include &lt;wtf/UniStdExtras.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace CoreIPC {
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +48,7 @@
</span><span class="cx"> void Attachment::dispose()
</span><span class="cx"> {
</span><span class="cx">     if (m_fileDescriptor != -1)
</span><del>-        while (close(m_fileDescriptor) == -1 &amp;&amp; (errno == EINTR)) { }
</del><ins>+        closeWithRetry(m_fileDescriptor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace CoreIPC
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformCoreIPCunixConnectionUnixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/Functional.h&gt;
</span><span class="cx"> #include &lt;wtf/OwnArrayPtr.h&gt;
</span><ins>+#include &lt;wtf/UniStdExtras.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(QT)
</span><span class="cx"> #include &lt;QPointer&gt;
</span><span class="lines">@@ -136,7 +137,7 @@
</span><span class="cx">     // In GTK+ platform the socket is closed by the work queue.
</span><span class="cx"> #if !PLATFORM(GTK)
</span><span class="cx">     if (m_socketDescriptor != -1)
</span><del>-        while (close(m_socketDescriptor) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+        closeWithRetry(m_socketDescriptor);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!m_isConnected)
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformunixSharedMemoryUnixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/RandomNumber.h&gt;
</span><ins>+#include &lt;wtf/UniStdExtras.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -54,7 +55,7 @@
</span><span class="cx"> SharedMemory::Handle::~Handle()
</span><span class="cx"> {
</span><span class="cx">     if (!isNull())
</span><del>-        while (close(m_fileDescriptor) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+        closeWithRetry(m_fileDescriptor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SharedMemory::Handle::isNull() const
</span><span class="lines">@@ -116,7 +117,7 @@
</span><span class="cx"> 
</span><span class="cx">     while (ftruncate(fileDescriptor, size) == -1) {
</span><span class="cx">         if (errno != EINTR) {
</span><del>-            while (close(fileDescriptor) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(fileDescriptor);
</ins><span class="cx">             shm_unlink(tempName.data());
</span><span class="cx">             return 0;
</span><span class="cx">         }
</span><span class="lines">@@ -124,7 +125,7 @@
</span><span class="cx"> 
</span><span class="cx">     void* data = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileDescriptor, 0);
</span><span class="cx">     if (data == MAP_FAILED) {
</span><del>-        while (close(fileDescriptor) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+        closeWithRetry(fileDescriptor);
</ins><span class="cx">         shm_unlink(tempName.data());
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="lines">@@ -170,7 +171,7 @@
</span><span class="cx"> SharedMemory::~SharedMemory()
</span><span class="cx"> {
</span><span class="cx">     munmap(m_data, m_size);
</span><del>-    while (close(m_fileDescriptor) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+    closeWithRetry(m_fileDescriptor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline int accessModeFile(SharedMemory::Protection protection)
</span><span class="lines">@@ -202,7 +203,7 @@
</span><span class="cx">     while ((fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC | accessModeFile(protection)) == -1)) {
</span><span class="cx">         if (errno != EINTR) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            while (close(duplicatedHandle) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(duplicatedHandle);
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2PluginProcessPluginProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> #include &lt;sys/resource.h&gt;
</span><span class="cx"> #include &lt;sys/socket.h&gt;
</span><span class="cx"> #include &lt;unistd.h&gt;
</span><ins>+#include &lt;wtf/UniStdExtras.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #ifdef SOCK_SEQPACKET
</span><span class="cx"> #define SOCKET_TYPE SOCK_SEQPACKET
</span><span class="lines">@@ -192,8 +193,8 @@
</span><span class="cx">     while (fcntl(sockets[1], F_SETFD, FD_CLOEXEC)  == -1) {
</span><span class="cx">         if (errno != EINTR) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            while (close(sockets[0]) == -1 &amp;&amp; errno == EINTR) { }
-            while (close(sockets[1]) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(sockets[0]);
+            closeWithRetry(sockets[1]);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -202,8 +203,8 @@
</span><span class="cx">     while (fcntl(sockets[0], F_SETFD, FD_CLOEXEC) == -1) {
</span><span class="cx">         if (errno != EINTR) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            while (close(sockets[0]) == -1 &amp;&amp; errno == EINTR) { }
-            while (close(sockets[1]) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(sockets[0]);
+            closeWithRetry(sockets[1]);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWorkerProcessSharedWorkerProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include &lt;sys/resource.h&gt;
</span><span class="cx"> #include &lt;sys/socket.h&gt;
</span><span class="cx"> #include &lt;unistd.h&gt;
</span><ins>+#include &lt;wtf/UniStdExtras.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #ifdef SOCK_SEQPACKET
</span><span class="cx"> #define SOCKET_TYPE SOCK_SEQPACKET
</span><span class="lines">@@ -139,8 +140,8 @@
</span><span class="cx">     while (fcntl(sockets[1], F_SETFD, FD_CLOEXEC)  == -1) {
</span><span class="cx">         if (errno != EINTR) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            while (close(sockets[0]) == -1 &amp;&amp; errno == EINTR) { }
-            while (close(sockets[1]) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(sockets[0]);
+            closeWithRetry(sockets[1]);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -149,8 +150,8 @@
</span><span class="cx">     while (fcntl(sockets[0], F_SETFD, FD_CLOEXEC) == -1) {
</span><span class="cx">         if (errno != EINTR) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            while (close(sockets[0]) == -1 &amp;&amp; errno == EINTR) { }
-            while (close(sockets[1]) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(sockets[0]);
+            closeWithRetry(sockets[1]);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessLauncherqtProcessLauncherQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp (151824 => 151825)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp        2013-06-21 04:21:54 UTC (rev 151824)
+++ trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp        2013-06-21 06:02:58 UTC (rev 151825)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> #include &lt;sys/resource.h&gt;
</span><span class="cx"> #include &lt;sys/socket.h&gt;
</span><span class="cx"> #include &lt;unistd.h&gt;
</span><ins>+#include &lt;wtf/UniStdExtras.h&gt;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if defined(Q_OS_LINUX)
</span><span class="lines">@@ -162,8 +163,8 @@
</span><span class="cx">     while (fcntl(sockets[1], F_SETFD, FD_CLOEXEC)  == -1) {
</span><span class="cx">         if (errno != EINTR) {
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            while (close(sockets[0]) == -1 &amp;&amp; errno == EINTR) { }
-            while (close(sockets[1]) == -1 &amp;&amp; errno == EINTR) { }
</del><ins>+            closeWithRetry(sockets[0]);
+            closeWithRetry(sockets[1]);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>