Re: SO_NOSIGPIPE

2011-03-13 Thread Chris Turner

On 03/12/11 08:55, Sascha Wildner wrote:

Same goes for NetBSD and OpenBSD. Someone obviously confuses FreeBSD
with BSD there. But hey, that's still better than confusing portable
with should compile on all Linux distros. :)


What - so you're not running the latest *BSD 'distro?

I for one am running the Dragonfly 'distro' of xBSD, as well
as the NetBSD 'distro', and the OpenBSD 'distro' myself.

If this doesn't work I suggest updating your xBSD 'distro' -
there are links available at distrowatch.org

AARRGGHH

:D


Re: SO_NOSIGPIPE

2011-03-12 Thread Sascha Wildner

On 3/12/2011 0:17, Pierre Abbat wrote:

I'm trying to compile Bitcoin and I get the following (after configuring
wxWidgets correctly and installing a few packages):

# gmake -f ./makefile.unix
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL 
-I/usr/local/include/wx-2.9 -I/usr/pkg/include -I/usr/pkg/include/db5 
-I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 -DGUI -o
obj/net.o net.cpp
net.cpp: In function 'bool ConnectSocket(const CAddress, SOCKET)':
net.cpp:70: error: 'SO_NOSIGPIPE' was not declared in this scope
net.cpp: In function 'bool BindListenPort(std::string)':
net.cpp:1254: error: 'SO_NOSIGPIPE' was not declared in this scope
gmake: *** [obj/net.o] Error 1

I look at net.cpp and find this:

#ifdef BSD
 int set = 1;
 setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)set, sizeof(int));
#endif

#ifdef BSD
 // Different way of disabling SIGPIPE on BSD
 setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)nOne,
sizeof(int
));
#endif

Is something else missing from an include file, or is there no SO_NOSIGPIPE on
DFly?


No, there isn't.

Same goes for NetBSD and OpenBSD. Someone obviously confuses FreeBSD 
with BSD there. But hey, that's still better than confusing portable 
with should compile on all Linux distros. :)


A saner way would be to replace those #ifdef BSD with #ifdef 
SO_NOSIGPIPE in order to check if the system allows turning off SIGPIPE 
for a socket. This is how for example BIND does it.


Try that.

Sascha


SO_NOSIGPIPE

2011-03-11 Thread Pierre Abbat
I'm trying to compile Bitcoin and I get the following (after configuring 
wxWidgets correctly and installing a few packages):

# gmake -f ./makefile.unix
g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -D__WXGTK__ -DNOPCH 
-DFOURWAYSSE2 -DUSE_SSL -I/usr/local/include/wx-2.9 -I/usr/pkg/include 
-I/usr/pkg/include/db5 -I/usr/local/lib/wx/include/gtk2-unicode-static-2.9 
-DGUI -o 
obj/net.o net.cpp
net.cpp: In function 'bool ConnectSocket(const CAddress, SOCKET)':
net.cpp:70: error: 'SO_NOSIGPIPE' was not declared in this scope
net.cpp: In function 'bool BindListenPort(std::string)':
net.cpp:1254: error: 'SO_NOSIGPIPE' was not declared in this scope
gmake: *** [obj/net.o] Error 1

I look at net.cpp and find this:

#ifdef BSD
int set = 1;
setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)set, sizeof(int));
#endif

#ifdef BSD
// Different way of disabling SIGPIPE on BSD
setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)nOne, 
sizeof(int
));
#endif

Is something else missing from an include file, or is there no SO_NOSIGPIPE on 
DFly?

Pierre

-- 
I believe in Yellow when I'm in Sweden and in Black when I'm in Wales.