This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Failed non-blocking connect returns incorrect errno on AF_UNIXprotocol


David Huang wrote:
Failed non-blocking connect returns incorrect errno on AF_UNIX protocol.
See attached test program.

On cygwin:
$ ./afunix
EINPROGRESS: Operation now in progress

On
Linux 2.4 (Debian 2.2)
Linux 2.4 (Redhat 7.3)
Sun Solaris (8):
$ ./afunix
ECONNREFUSED: Connection refused

When i comment following code:
//    if (fcntl (fd2, F_SETFL, O_NONBLOCK) < 0)
//        printf ("Failed to set fd non-blocking");
The result is
ECONNREFUSED: Connection refused

It seems an old bug.
I don't know whether it effect others address/protocol families.


Thanks.

Corinna,


according to http://www.opengroup.org/onlinepubs/007904975/toc.htm EINPROGRESS is not a valid errno if the address family is AF_UNIX.

I would suggest to check for AF_UNIX address family in fhandler_socket::connect and make the connect blocking under that condition.

Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]