From: Ken Brown <kbrown@cornell.edu>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 23615@debbugs.gnu.org
Subject: bug#23615: 25.1.50; Which platforms can safely use getsockopt(,,SO_ERROR,,)?
Date: Thu, 2 Jun 2016 13:55:14 -0400 [thread overview]
Message-ID: <94329b2c-754f-c674-daa9-362284862220@cornell.edu> (raw)
In-Reply-To: <c09d6c7d-e394-330c-1639-753eda5cc95f@cornell.edu>
On 6/2/2016 1:17 PM, Ken Brown wrote:
> On 6/2/2016 12:00 PM, Paul Eggert wrote:
>> On Solaris 10 on a host with only IPv4 configured, socket_test.c fails
>> with the diagnostic "Can't start server." 'truss' says connect(3,
>> 0x00021EE8, 16, SOV_DEFAULT) failed with errno == EOPNOTSUPP.
>>
>> On Solaris 11 with both IPv4 and IPv6, the same symptoms except errno ==
>> EADDRNOTAVAIL.
>
> Thanks for testing. This means that my test program is not portable
> enough to answer the question in the subject; the failure occurred
> before the program reached the getsockopt call. I'll see if I can fix
> that.
I wonder if the problem was calling 'connect' after calling 'listen'.
Eli pointed out that this doesn't work on MS-Windows, and in any case I
can't see why it would ever be needed. (I only did it because the code
in process.c that I was imitating did it.)
Does the following help?
--- socket_test.c~ 2016-05-25 21:27:46.000000000 -0400
+++ socket_test.c 2016-06-02 13:47:52.719883900 -0400
@@ -122,6 +122,7 @@
return -1;
}
*pservice = ntohs (sa.sin_port);
+ ret = 0;
}
else
/* Nonblocking client. */
@@ -132,8 +133,8 @@
s = -1;
continue;
}
+ ret = connect (s, rp->ai_addr, rp->ai_addrlen);
}
- ret = connect (s, rp->ai_addr, rp->ai_addrlen);
if (ret == 0 || errno == EISCONN)
break;
if (!server && errno == EINPROGRESS)
next prev parent reply other threads:[~2016-06-02 17:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 0:26 bug#23615: 25.1.50; Which platforms can safely use getsockopt(,,SO_ERROR,,)? Ken Brown
2016-05-25 16:24 ` Eli Zaretskii
2016-05-25 19:21 ` Ken Brown
2016-05-28 12:57 ` Eli Zaretskii
2016-05-28 17:18 ` Ken Brown
2016-05-28 17:48 ` Eli Zaretskii
2016-06-02 16:00 ` Paul Eggert
2016-06-02 17:17 ` Ken Brown
2016-06-02 17:55 ` Ken Brown [this message]
2016-06-02 18:55 ` Ken Brown
2016-06-10 12:38 ` Ken Brown
2016-06-10 17:48 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94329b2c-754f-c674-daa9-362284862220@cornell.edu \
--to=kbrown@cornell.edu \
--cc=23615@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).