From 4673305fcc18bff147330424f697b2c4da514d36 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 25 Aug 2013 21:06:29 +0000 Subject: [PATCH] patch from Stefan Sperling to allow compilation on OpenBSD git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6613 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- src/libbitdht.pro | 6 ++++++ src/util/bdrandom.cc | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/libbitdht.pro b/src/libbitdht.pro index dfeb1d1..5d5e499 100644 --- a/src/libbitdht.pro +++ b/src/libbitdht.pro @@ -93,6 +93,12 @@ freebsd-* { DESTDIR = lib } +################################# OpenBSD ########################################## + +openbsd-* { + DESTDIR = lib +} + ################################### COMMON stuff ################################## ################################### COMMON stuff ################################## diff --git a/src/util/bdrandom.cc b/src/util/bdrandom.cc index c680ab7..bd0e9c6 100644 --- a/src/util/bdrandom.cc +++ b/src/util/bdrandom.cc @@ -15,6 +15,8 @@ static bool auto_seed = bdRandom::seed( (time(NULL) + ((uint32_t) pthread_self() #elif defined(__FreeBSD__) // since this is completely insecure anyway, just kludge for now static bool auto_seed = bdRandom::seed(time(NULL)); + #elif defined(__OpenBSD__) + static bool auto_seed = bdRandom::seed(arc4random()); #else static bool auto_seed = bdRandom::seed( (time(NULL) + pthread_self()*0x1293fe + (getpid()^0x113ef76b))^0x18e34a12 ) ; #endif