Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Mar 5, 2017

build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL

Instead of the WIN32-specific workaround, detect lack of MSG_DONTWAIT in the build system. This allows other platforms without MSG_DONTWAIT to work too.

build: cleanup: define MSG_DONTWAIT/MSG_NO_SIGNAL locall

Define MSG_DONTWAIT and MSG_NO_SIGNAL in the implementation files that use them (net.cpp and netbase.cpp), instead of compat.h which is included all over the place.

This avoids putting them in the global namespace, as defining them as 0 is a hack that works for our specific usage, but it is not a general solution.

Also makes sure they are defined only once so the !defined(MSG_x) guard can go.

compat: use unsigned int instead of u_int

u_int (without size specifier) is not available on some platforms (not sure what standard it's supposed to be part of), we don't use it anywhere else, and it doesn't hurt to simply write unsigned int out here.

laanwj added 3 commits March 5, 2017 09:29
Instead of the WIN32-specific workaround, detect lack of `MSG_DONTWAIT`
in the build system. This allows other platforms without `MSG_DONTWAIT`
to work too.
Define MSG_DONTWAIT and MSG_NO_SIGNAL in the implementation files that
use them (`net.cpp` and `netbase.cpp`), instead of compat.h which is
included all over the place.

This avoids putting them in the global namespace, as defining them as 0
is a hack that works for our specific usage, but it is not a general
solution.

Also makes sure they are defined only once so the `!defined(MSG_x)` guard can go.
`u_int` is not available on some platforms (not sure what standard it's
supposed to be part of), we don't use it anywhere else, and it doesn't
hurt to simply write `unsigned int` out here.
@theuni
Copy link
Member

theuni commented Mar 15, 2017

Whoops, missed the assignment here (saw your IRC ping though, thanks!). utACK a4d1c9f. Yes, Much of this stuff goes away with libevent. I like the move out of compat as well. For anything that libevent doesn't end up absorbing, it'd be nice to make everything else local the same way.

@laanwj laanwj merged commit a4d1c9f into bitcoin:master Mar 16, 2017
laanwj added a commit that referenced this pull request Mar 16, 2017
a4d1c9f compat: use `unsigned int` instead of `u_int` (Wladimir J. van der Laan)
25da1ee build: cleanup: define MSG_DONTWAIT/MSG_NO_SIGNAL locally (Wladimir J. van der Laan)
c459d50 build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL (Wladimir J. van der Laan)

Tree-SHA512: 60d79d69439bb181465e4244aa5ddc28bbd84f69c0ca0c753956b3798c9022394e29d791bc085fe7ffb1268c64c789a57e24797daad63525bb776088188ff9ae
laanwj added a commit to laanwj/bitcoin that referenced this pull request Mar 16, 2017
Introduced in bitcoin#9921.

Thanks to Pavol Rusnak for spotting this one.
@theuni theuni mentioned this pull request Apr 3, 2017
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request May 6, 2019
…NOSIGNAL

a4d1c9f compat: use `unsigned int` instead of `u_int` (Wladimir J. van der Laan)
25da1ee build: cleanup: define MSG_DONTWAIT/MSG_NO_SIGNAL locally (Wladimir J. van der Laan)
c459d50 build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL (Wladimir J. van der Laan)

Tree-SHA512: 60d79d69439bb181465e4244aa5ddc28bbd84f69c0ca0c753956b3798c9022394e29d791bc085fe7ffb1268c64c789a57e24797daad63525bb776088188ff9ae

fix merge error in configure.ac

Signed-off-by: Pasta <Pasta@dash.org>
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants