Bug 95553 - [Qt] QNX does not support SOCK_SEQPACKET socket type for socketpair in ProcessLauncherQt
Summary: [Qt] QNX does not support SOCK_SEQPACKET socket type for socketpair in Proces...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Milian Wolff
URL:
Keywords:
Depends on:
Blocks: 95466
  Show dependency treegraph
 
Reported: 2012-08-31 04:12 PDT by Milian Wolff
Modified: 2012-08-31 06:33 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.73 KB, patch)
2012-08-31 04:20 PDT, Milian Wolff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Milian Wolff 2012-08-31 04:12:22 PDT
Running a WebKit2/QML app on QNX shows this debug output:

Creation of socket failed with errno: 241

This is from ProcessLauncherQt.cpp, where we currently have:

#if defined(SOCK_SEQPACKET) && !defined(Q_OS_MACX)
#define SOCKET_TYPE SOCK_SEQPACKET
#else
#define SOCKET_TYPE SOCK_DGRAM
#endif

Thus on QNX the SOCK_SEQPACKET socket type is passed to socketpair futher below. On QNX this is apparently not supported, as can be reproduced with this minimal test case:

#include <sys/socket.h>
#include <stdio.h>

int main(int argc, char** argv)
{
    int fds[2];
    char c;

    if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds) == -1) {
        perror("socketpair");
        return 1;
    }

    if (send(fds[0], "a", 1, 0) == -1) {
        perror("send");
        return 1;
    }

    if (recv(fds[1], &c, 1, 0) == -1) {
        perror("recv");
        return 1;
    }

    printf("%c\n", c);

    return 0;
}

The output on a Playbook (bbndk 2.0.1) is: socketpair: Protocol wrong type for socket

Changing SOCK_SEQPACKET to SOCK_DGRAM in the example makes it work, i.e. the output will be "a".

Thus I propose to use SOCK_DGRAM in ProcessLauncherQt.cpp as well, I'll publish a patch.
Comment 1 Milian Wolff 2012-08-31 04:20:14 PDT
Created attachment 161661 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-31 06:33:36 PDT
Comment on attachment 161661 [details]
Patch

Clearing flags on attachment: 161661

Committed r127253: <http://trac.webkit.org/changeset/127253>
Comment 3 WebKit Review Bot 2012-08-31 06:33:39 PDT
All reviewed patches have been landed.  Closing bug.