[erlang-patches] Montavista system call error handling patch

Raimo Niskanen <>
Wed May 19 16:31:07 CEST 2010


On Wed, May 19, 2010 at 09:55:59AM -0400, Steve Vinoski wrote:
> Thanks guys. Shall I still grab Björn's changes and incorporate them
> into my branch, or is the process on track without me doing that? I
> guess you may not need anything from my branch at this point but I
> should get Björn's changes anyway, just for completeness and accuracy?

I take it from Björn's branch. If you want to continue
or fix anything more, please continue on Björn's branch too.

> 
> thanks,
> --steve
> 
> 2010/5/19 Raimo Niskanen <>:
> > I have fetched from Björn's combined branch.
> >
> > So it will soon be included in 'pu'... even if I might have
> > asked for more help from Steve earlier; I did not see
> > Björn had a ready made branch. Sloppy reading on my part.
> > Sorry about that.
> >
> > On Wed, May 19, 2010 at 08:49:21AM +0200, Björn Gustavsson wrote:
> >> 2010/5/18 Steve Vinoski <>:
> >> > 2010/5/18 Björn Gustavsson <>:
> >> >> 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:
> >>
> >
> > --
> >
> > / Raimo Niskanen, Erlang/OTP, Ericsson AB
> >

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list