Work around missing getsockopt support in hurd.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39922 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-06-25 19:00:43 +00:00
parent d9d4cd2982
commit 39c966a12f
2 changed files with 8 additions and 1 deletions

View file

@ -2,7 +2,8 @@
* Source/NSMessagePort.m:
* config/config.reuseaddr.c:
SO_REUSEADDR fixes.
Hack to work around Hurd local domain socket bug.
Plus don't try to set SO_REUSEADDR on local domain sockets anyway.
2016-06-25 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -893,6 +893,11 @@ static Class runLoopClass;
int res = 0;
unsigned len = sizeof(res);
/* Currently gnu hurd doesn't support getsockopt on local domain sockets
* and fails with a 'protocol not supported' error.
* We therefore just hope the connect was a success.
*/
#if !defined(__gnu_hurd__)
if (getsockopt(desc, SOL_SOCKET, SO_ERROR, (char*)&res, &len) != 0)
{
state = GS_H_UNCON;
@ -905,6 +910,7 @@ static Class runLoopClass;
[NSError _systemError: res]);
}
else
#endif
{
NSData *d = newDataWithEncodedPort([self recvPort]);