aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2013-08-24 20:19:24 -0700
committerJeff Garzik <jgarzik@bitpay.com>2013-08-24 20:19:24 -0700
commit3d86e7cd48f8a25a8f1b63a2e8220b56eb1f7b11 (patch)
treeb584599e7e2e3249b6da7192998f17e0dffd7fb4 /src
parent750ae29664d0e1fd50df464790d8e6aaa666946a (diff)
parent98148a713e6e671f1d993ce4dc7aa4654b4beaff (diff)
downloadbitcoin-3d86e7cd48f8a25a8f1b63a2e8220b56eb1f7b11.tar.xz
Merge pull request #2618 from fcicq/solaris-support
Partial solaris support
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp5
-rw-r--r--src/makefile.unix2
-rw-r--r--src/net.cpp4
-rw-r--r--src/netbase.cpp2
-rw-r--r--src/script.cpp12
-rw-r--r--src/util.h8
6 files changed, 25 insertions, 8 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 7263565047..db368c7f53 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -368,6 +368,11 @@ bool AppInit2(boost::thread_group& threadGroup)
sigemptyset(&sa_hup.sa_mask);
sa_hup.sa_flags = 0;
sigaction(SIGHUP, &sa_hup, NULL);
+
+#if defined (__SVR4) && defined (__sun)
+ // ignore SIGPIPE on Solaris
+ signal(SIGPIPE, SIG_IGN);
+#endif
#endif
// ********************************************************* Step 2: parameter interactions
diff --git a/src/makefile.unix b/src/makefile.unix
index e00db09a33..55fd594f93 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -13,7 +13,7 @@ USE_IPV6:=1
LINK:=$(CXX)
-DEFS=-DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64
+DEFS=-DBOOST_SPIRIT_THREADSAFE -DBOOST_NO_CXX11_VARIADIC_TEMPLATES -D_FILE_OFFSET_BITS=64
DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/obj $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
diff --git a/src/net.cpp b/src/net.cpp
index 4ee1895a80..1f461e55db 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -15,6 +15,10 @@
#include <string.h>
#endif
+#ifndef WIN32
+#include <fcntl.h>
+#endif
+
#ifdef USE_UPNP
#include <miniupnpc/miniwget.h>
#include <miniupnpc/miniupnpc.h>
diff --git a/src/netbase.cpp b/src/netbase.cpp
index 08d133740a..348771375c 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -9,7 +9,7 @@
#include "hash.h"
#ifndef WIN32
-#include <sys/fcntl.h>
+#include <fcntl.h>
#endif
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
diff --git a/src/script.cpp b/src/script.cpp
index 2df2e9f0d5..2225ef1665 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -2,12 +2,6 @@
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include <boost/foreach.hpp>
-#include <boost/tuple/tuple.hpp>
-
-using namespace std;
-using namespace boost;
-
#include "script.h"
#include "core.h"
#include "keystore.h"
@@ -16,6 +10,12 @@ using namespace boost;
#include "sync.h"
#include "util.h"
+#include <boost/foreach.hpp>
+#include <boost/tuple/tuple.hpp>
+
+using namespace std;
+using namespace boost;
+
bool CheckSig(vector<unsigned char> vchSig, const vector<unsigned char> &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags);
diff --git a/src/util.h b/src/util.h
index c9614d3055..f246412de0 100644
--- a/src/util.h
+++ b/src/util.h
@@ -101,6 +101,10 @@ T* alignup(T* p)
#else
#define MAX_PATH 1024
#endif
+// As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
inline void MilliSleep(int64 n)
{
@@ -515,6 +519,10 @@ inline void SetThreadPriority(int nPriority)
}
#else
+// PRIO_MAX is not defined on Solaris
+#ifndef PRIO_MAX
+ #define PRIO_MAX 20
+#endif
#define THREAD_PRIORITY_LOWEST PRIO_MAX
#define THREAD_PRIORITY_BELOW_NORMAL 2
#define THREAD_PRIORITY_NORMAL 0