Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  Montavista system call error handling patch

Guest
Posted: Tue May 18, 2010 7:53 pm Reply with quote
Guest
2010/5/18 Bj
Guest
Posted: Wed May 19, 2010 6:49 am Reply with quote
Guest
2010/5/18 Steve Vinoski <vinoski@ieee.org>:
> 2010/5/18 Björn Gustavsson <bgustavsson@gmail.com>:
>> The build problem exposes a place where the new IS_SOCKET_ERROR()
>> macro is not used.
>>
>> Another thing is that the Windows version of the macro should still
>> use SOCKET_ERROR:
>>
>> #define IS_SOCKET_ERROR(val) ((val) == SOCKET_ERROR)
>>
>> since SOCKET_ERROR is defined in a header file on Windows.
>>
>> Because of the build error, Raimo has taken out the branch
>> from the pu branch. He will re-instate it as soon as you have
>> fixed the build problem.
>
> Sorry about that, I messed it up when I removed SOCKET_ERROR as you
> had suggested. I've restored SOCKET_ERROR since it's still used in the
> Windows code, and found and fixed the one place that needed the new
> IS_SOCKET_ERROR macro but wasn't using it. It all builds correctly
> again.

Thanks!

SOCKET_ERROR really must be defined, but the reason
why it must be defined is that the value of SOCKET_ERROR
is returned from the functions erts_sock_send() and
erts_sock_gethostname() at the end of the file. On Windows,
SOCKET_ERROR is defined in the winsock2.h header file.

One more change is necessary to get it build on Windows.
The macro definition for IS_SOCKET_ERROR() is inside
the #else part of a huge #ifdef and will only be defined on
Unix systems. It must be moved like this:

http://github.com/bjorng/otp/commit/6fc366caffca7a6cf9c5aff084d169da18ca9efa

(That commit should be combined with the previous
commit before including the branch in pu.)

Since the #ifdef structure is complicated in the inet_drv.c, I suggest
that a red herring (that fooled me for a while) should be eliminated:

http://github.com/bjorng/otp/commit/fcc0f94ef1831751cf8ae8be209a5cb0f442854f

My updated version of the branch can be found here:

git fetch git://github.com/bjorng/otp.git sv/socket-error-portability

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed May 19, 2010 6:49 am Reply with quote
Guest
2010/5/18 Steve Vinoski <vinoski@ieee.org>:
> 2010/5/18 Björn Gustavsson <bgustavsson@gmail.com>:
>> The build problem exposes a place where the new IS_SOCKET_ERROR()
>> macro is not used.
>>
>> Another thing is that the Windows version of the macro should still
>> use SOCKET_ERROR:
>>
>> #define IS_SOCKET_ERROR(val) ((val) == SOCKET_ERROR)
>>
>> since SOCKET_ERROR is defined in a header file on Windows.
>>
>> Because of the build error, Raimo has taken out the branch
>> from the pu branch. He will re-instate it as soon as you have
>> fixed the build problem.
>
> Sorry about that, I messed it up when I removed SOCKET_ERROR as you
> had suggested. I've restored SOCKET_ERROR since it's still used in the
> Windows code, and found and fixed the one place that needed the new
> IS_SOCKET_ERROR macro but wasn't using it. It all builds correctly
> again.

Thanks!

SOCKET_ERROR really must be defined, but the reason
why it must be defined is that the value of SOCKET_ERROR
is returned from the functions erts_sock_send() and
erts_sock_gethostname() at the end of the file. On Windows,
SOCKET_ERROR is defined in the winsock2.h header file.

One more change is necessary to get it build on Windows.
The macro definition for IS_SOCKET_ERROR() is inside
the #else part of a huge #ifdef and will only be defined on
Unix systems. It must be moved like this:

http://github.com/bjorng/otp/commit/6fc366caffca7a6cf9c5aff084d169da18ca9efa

(That commit should be combined with the previous
commit before including the branch in pu.)

Since the #ifdef structure is complicated in the inet_drv.c, I suggest
that a red herring (that fooled me for a while) should be eliminated:

http://github.com/bjorng/otp/commit/fcc0f94ef1831751cf8ae8be209a5cb0f442854f

My updated version of the branch can be found here:

git fetch git://github.com/bjorng/otp.git sv/socket-error-portability

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed May 19, 2010 2:31 pm Reply with quote
Guest
On Wed, May 19, 2010 at 09:55:59AM -0400, Steve Vinoski wrote:
> Thanks guys. Shall I still grab Bj
Guest
Posted: Wed May 19, 2010 2:31 pm Reply with quote
Guest
On Wed, May 19, 2010 at 09:55:59AM -0400, Steve Vinoski wrote:
> Thanks guys. Shall I still grab Bj

Display posts from previous:  

All times are GMT
Page 2 of 2
Goto page Previous  1, 2
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum