Title: [163292] trunk/Source/WebKit2
Revision
163292
Author
be...@igalia.com
Date
2014-02-03 00:19:13 -0800 (Mon, 03 Feb 2014)

Log Message

Fix wrong mix of fcntl commands and flags
https://bugs.webkit.org/show_bug.cgi?id=127842

Reviewed by Darin Adler.

We are mixing the commands to set file descriptor and file status
flags in a couple of fcntl() calls. FD_CLOEXEC must be set using
F_SETFD, and the access mode flags (O_RDONLY, O_WRONLY, O_RDWR)
with F_SETFL.

This combines patches by Guillem Jover and Sergio Correia.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::readBytesFromSocket):
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::createHandle):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163291 => 163292)


--- trunk/Source/WebKit2/ChangeLog	2014-02-03 08:17:33 UTC (rev 163291)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-03 08:19:13 UTC (rev 163292)
@@ -1,3 +1,22 @@
+2014-02-03  Alberto Garcia  <be...@igalia.com>
+
+        Fix wrong mix of fcntl commands and flags
+        https://bugs.webkit.org/show_bug.cgi?id=127842
+
+        Reviewed by Darin Adler.
+
+        We are mixing the commands to set file descriptor and file status
+        flags in a couple of fcntl() calls. FD_CLOEXEC must be set using
+        F_SETFD, and the access mode flags (O_RDONLY, O_WRONLY, O_RDWR)
+        with F_SETFL.
+
+        This combines patches by Guillem Jover and Sergio Correia.
+
+        * Platform/IPC/unix/ConnectionUnix.cpp:
+        (IPC::readBytesFromSocket):
+        * Platform/unix/SharedMemoryUnix.cpp:
+        (WebKit::SharedMemory::createHandle):
+
 2014-02-02  Brady Eidson  <beid...@apple.com>
 
         IDB: Cannot open new databases with the default version

Modified: trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp (163291 => 163292)


--- trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp	2014-02-03 08:17:33 UTC (rev 163291)
+++ trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp	2014-02-03 08:19:13 UTC (rev 163292)
@@ -321,7 +321,7 @@
                 memcpy(fileDescriptors, CMSG_DATA(controlMessage), sizeof(int) * *fileDescriptorsCount);
 
                 for (size_t i = 0; i < *fileDescriptorsCount; ++i) {
-                    while (fcntl(fileDescriptors[i], F_SETFL, FD_CLOEXEC) == -1) {
+                    while (fcntl(fileDescriptors[i], F_SETFD, FD_CLOEXEC) == -1) {
                         if (errno != EINTR) {
                             ASSERT_NOT_REACHED();
                             break;

Modified: trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp (163291 => 163292)


--- trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp	2014-02-03 08:17:33 UTC (rev 163291)
+++ trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp	2014-02-03 08:19:13 UTC (rev 163292)
@@ -200,7 +200,7 @@
         }
     }
 
-    while ((fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC | accessModeFile(protection)) == -1)) {
+    while (fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC) == -1 || fcntl(duplicatedHandle, F_SETFL, accessModeFile(protection)) == -1) {
         if (errno != EINTR) {
             ASSERT_NOT_REACHED();
             closeWithRetry(duplicatedHandle);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to