Changeset 151825 in webkit
- Timestamp:
- Jun 20, 2013 11:02:58 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r151817 r151825 1 2013-06-20 Sergio Correia <sergio.correia@openbossa.org> 2 3 [WK2] Looping for EINTR on close() is incorrect for Linux, at least 4 https://bugs.webkit.org/show_bug.cgi?id=117266 5 6 Reviewed by Darin Adler. 7 8 Added file UniStdExtras with a closeWithRetry() function that works around 9 the EINTR behavior on Linux during a close() call: it closes the descriptor 10 unconditionally even when the call is interrupted. 11 12 * wtf/UniStdExtras.h: Added. 13 (WTF::closeWithRetry): Wrapper around POSIX close() that handles EINTR 14 correctly. 15 1 16 2013-06-20 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/Source/WebKit2/ChangeLog
r151795 r151825 1 2013-06-20 Sergio Correia <sergio.correia@openbossa.org> 2 3 [WK2] Looping for EINTR on close() is incorrect for Linux, at least 4 https://bugs.webkit.org/show_bug.cgi?id=117266 5 6 Reviewed by Darin Adler. 7 8 Call closeWithRetry() to work around a difference in how the retry needs to 9 be done on Linux. 10 11 * Platform/CoreIPC/unix/AttachmentUnix.cpp: 12 (CoreIPC::Attachment::dispose): 13 * Platform/CoreIPC/unix/ConnectionUnix.cpp: 14 (CoreIPC::Connection::platformInvalidate): 15 * Platform/unix/SharedMemoryUnix.cpp: 16 (WebKit::SharedMemory::Handle::~Handle): 17 (WebKit::SharedMemory::create): 18 (WebKit::SharedMemory::~SharedMemory): 19 (WebKit::SharedMemory::createHandle): 20 * PluginProcess/PluginProcess.cpp: 21 (WebKit::PluginProcess::createWebProcessConnection): 22 * SharedWorkerProcess/SharedWorkerProcess.cpp: 23 (WebKit::SharedWorkerProcess::createWebProcessConnection): 24 * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: 25 (WebKit::ProcessLauncher::launchProcess): All these places had 26 ``close-followed-by-EINTR-handling'' replaced with the new closeWithRetry() 27 function added in this commit. 28 1 29 2013-06-20 Brady Eidson <beidson@apple.com> 2 30 -
trunk/Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp
r95901 r151825 28 28 #include "Attachment.h" 29 29 30 #include <unistd.h> 31 #include <errno.h> 30 #include <wtf/UniStdExtras.h> 32 31 33 32 namespace CoreIPC { … … 50 49 { 51 50 if (m_fileDescriptor != -1) 52 while (close(m_fileDescriptor) == -1 && (errno == EINTR)) { }51 closeWithRetry(m_fileDescriptor); 53 52 } 54 53 -
trunk/Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp
r150808 r151825 38 38 #include <wtf/Functional.h> 39 39 #include <wtf/OwnArrayPtr.h> 40 #include <wtf/UniStdExtras.h> 40 41 41 42 #if PLATFORM(QT) … … 137 138 #if !PLATFORM(GTK) 138 139 if (m_socketDescriptor != -1) 139 while (close(m_socketDescriptor) == -1 && errno == EINTR) { }140 closeWithRetry(m_socketDescriptor); 140 141 #endif 141 142 -
trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp
r151324 r151825 42 42 #include <wtf/CurrentTime.h> 43 43 #include <wtf/RandomNumber.h> 44 #include <wtf/UniStdExtras.h> 44 45 #include <wtf/text/CString.h> 45 46 … … 55 56 { 56 57 if (!isNull()) 57 while (close(m_fileDescriptor) == -1 && errno == EINTR) { }58 closeWithRetry(m_fileDescriptor); 58 59 } 59 60 … … 117 118 while (ftruncate(fileDescriptor, size) == -1) { 118 119 if (errno != EINTR) { 119 while (close(fileDescriptor) == -1 && errno == EINTR) { }120 closeWithRetry(fileDescriptor); 120 121 shm_unlink(tempName.data()); 121 122 return 0; … … 125 126 void* data = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileDescriptor, 0); 126 127 if (data == MAP_FAILED) { 127 while (close(fileDescriptor) == -1 && errno == EINTR) { }128 closeWithRetry(fileDescriptor); 128 129 shm_unlink(tempName.data()); 129 130 return 0; … … 171 172 { 172 173 munmap(m_data, m_size); 173 while (close(m_fileDescriptor) == -1 && errno == EINTR) { }174 closeWithRetry(m_fileDescriptor); 174 175 } 175 176 … … 203 204 if (errno != EINTR) { 204 205 ASSERT_NOT_REACHED(); 205 while (close(duplicatedHandle) == -1 && errno == EINTR) { }206 closeWithRetry(duplicatedHandle); 206 207 return false; 207 208 } -
trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp
r142521 r151825 51 51 #include <sys/socket.h> 52 52 #include <unistd.h> 53 #include <wtf/UniStdExtras.h> 53 54 54 55 #ifdef SOCK_SEQPACKET … … 193 194 if (errno != EINTR) { 194 195 ASSERT_NOT_REACHED(); 195 while (close(sockets[0]) == -1 && errno == EINTR) { }196 while (close(sockets[1]) == -1 && errno == EINTR) { }196 closeWithRetry(sockets[0]); 197 closeWithRetry(sockets[1]); 197 198 return; 198 199 } … … 203 204 if (errno != EINTR) { 204 205 ASSERT_NOT_REACHED(); 205 while (close(sockets[0]) == -1 && errno == EINTR) { }206 while (close(sockets[1]) == -1 && errno == EINTR) { }206 closeWithRetry(sockets[0]); 207 closeWithRetry(sockets[1]); 207 208 return; 208 209 } -
trunk/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp
r149413 r151825 47 47 #include <sys/socket.h> 48 48 #include <unistd.h> 49 #include <wtf/UniStdExtras.h> 49 50 50 51 #ifdef SOCK_SEQPACKET … … 140 141 if (errno != EINTR) { 141 142 ASSERT_NOT_REACHED(); 142 while (close(sockets[0]) == -1 && errno == EINTR) { }143 while (close(sockets[1]) == -1 && errno == EINTR) { }143 closeWithRetry(sockets[0]); 144 closeWithRetry(sockets[1]); 144 145 return; 145 146 } … … 150 151 if (errno != EINTR) { 151 152 ASSERT_NOT_REACHED(); 152 while (close(sockets[0]) == -1 && errno == EINTR) { }153 while (close(sockets[1]) == -1 && errno == EINTR) { }153 closeWithRetry(sockets[0]); 154 closeWithRetry(sockets[1]); 154 155 return; 155 156 } -
trunk/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
r146915 r151825 51 51 #include <sys/socket.h> 52 52 #include <unistd.h> 53 #include <wtf/UniStdExtras.h> 53 54 #endif 54 55 … … 163 164 if (errno != EINTR) { 164 165 ASSERT_NOT_REACHED(); 165 while (close(sockets[0]) == -1 && errno == EINTR) { }166 while (close(sockets[1]) == -1 && errno == EINTR) { }166 closeWithRetry(sockets[0]); 167 closeWithRetry(sockets[1]); 167 168 return; 168 169 }
Note: See TracChangeset
for help on using the changeset viewer.