Changeset 163292 in webkit


Ignore:
Timestamp:
Feb 3, 2014 12:19:13 AM (10 years ago)
Author:
berto@igalia.com
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):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r163287 r163292  
     12014-02-03  Alberto Garcia  <berto@igalia.com>
     2
     3        Fix wrong mix of fcntl commands and flags
     4        https://bugs.webkit.org/show_bug.cgi?id=127842
     5
     6        Reviewed by Darin Adler.
     7
     8        We are mixing the commands to set file descriptor and file status
     9        flags in a couple of fcntl() calls. FD_CLOEXEC must be set using
     10        F_SETFD, and the access mode flags (O_RDONLY, O_WRONLY, O_RDWR)
     11        with F_SETFL.
     12
     13        This combines patches by Guillem Jover and Sergio Correia.
     14
     15        * Platform/IPC/unix/ConnectionUnix.cpp:
     16        (IPC::readBytesFromSocket):
     17        * Platform/unix/SharedMemoryUnix.cpp:
     18        (WebKit::SharedMemory::createHandle):
     19
    1202014-02-02  Brady Eidson  <beidson@apple.com>
    221
  • trunk/Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp

    r162511 r163292  
    322322
    323323                for (size_t i = 0; i < *fileDescriptorsCount; ++i) {
    324                     while (fcntl(fileDescriptors[i], F_SETFL, FD_CLOEXEC) == -1) {
     324                    while (fcntl(fileDescriptors[i], F_SETFD, FD_CLOEXEC) == -1) {
    325325                        if (errno != EINTR) {
    326326                            ASSERT_NOT_REACHED();
  • trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp

    r161156 r163292  
    201201    }
    202202
    203     while ((fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC | accessModeFile(protection)) == -1)) {
     203    while (fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC) == -1 || fcntl(duplicatedHandle, F_SETFL, accessModeFile(protection)) == -1) {
    204204        if (errno != EINTR) {
    205205            ASSERT_NOT_REACHED();
Note: See TracChangeset for help on using the changeset viewer.