Skip to content

Commit

Permalink
Merge branch 'master' into s3_support_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
qris committed Jan 21, 2018
2 parents 8ee03a0 + 6d7e956 commit c12f691
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 41 deletions.
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,4 @@ deploy:
on:
branch:
- master
- s3_support_merge

2 changes: 1 addition & 1 deletion bin/bbstored/bbstored-certs.in
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ sub get_csr_common_name
my $subject;
while(<CSRTEXT>)
{
$subject = $1 if m/Subject:.+?CN=([-\.\w]+)/
$subject = $1 if m/Subject:.+?CN\s?=\s?([-\.\w]+)/;
}
close CSRTEXT;

Expand Down
9 changes: 6 additions & 3 deletions infrastructure/cmake/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ ExternalProject_Add(boost
URL "http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_UNDERSCORES}.tar.bz2"
URL_HASH ${BOOST_HASH}
# DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND "" # none needed
BUILD_COMMAND ${CMAKE_COMMAND} -E echo "No build step needed" # none needed
INSTALL_COMMAND "" # none needed
# Disable automatic updating (untarring) as it's slow and not necessary
UPDATE_DISCONNECTED 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "No configure step needed"
BUILD_COMMAND ${CMAKE_COMMAND} -E echo "No build step needed"
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "No install step needed"
)

if(BOXBACKUP_VERSION)
Expand All @@ -127,6 +129,7 @@ ExternalProject_Add(boxbackup
-DPCRE_ROOT=${install_dir}
-DBOOST_ROOT=${CMAKE_BINARY_DIR}/Source/boost
-DBOX_SUPPORT_READLINE=OFF
-DCMAKE_INSTALL_PREFIX=${install_dir}
-DAPPVEYOR_MODE=1
-DDEBUG=${DEBUG}
${boxbackup_cmake_args}
Expand Down
1 change: 1 addition & 0 deletions infrastructure/m4/boxbackup_tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ AC_CHECK_DECLS([INFTIM],,, [[#include <poll.h>]])
AC_CHECK_DECLS([SO_PEERCRED],,, [[#include <sys/socket.h>]])
AC_CHECK_DECLS([IPPROTO_TCP],,, [[#include <netinet/in.h>]])
AC_CHECK_DECLS([SOL_TCP,TCP_INFO,TCP_CONNECTION_INFO],,, [[#include <netinet/tcp.h>]])
AC_CHECK_DECLS([SYS_open, SYS_openat],,, [[#include <sys/syscall.h>]])

if test -n "$have_sys_socket_h"; then
AC_CHECK_DECLS([SO_SNDBUF],,, [[#include <sys/socket.h>]])
Expand Down
2 changes: 0 additions & 2 deletions lib/bbackupd/BackupDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,6 @@ std::auto_ptr<BackupClientContext> BackupDaemon::GetNewContext
// it, let it be destroyed and close the connection.
std::auto_ptr<BackupClientContext> BackupDaemon::RunSyncNow()
{
Timers::AssertInitialised();

// Delete the serialised store object file,
// so that we don't try to reload it after a
// partially completed backup
Expand Down
21 changes: 0 additions & 21 deletions lib/common/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,6 @@ void Timers::Cleanup(bool throw_exception_if_not_initialised)
spTimers = NULL;
}

// --------------------------------------------------------------------------
//
// Function
// Name: static void Timers::AssertInitialised()
// Purpose: Throw an assertion error if timers are not ready
// NOW. It's a common mistake (for me) when writing
// tests to forget to initialise timers first.
// Created: 15/05/2014
//
// --------------------------------------------------------------------------

void Timers::AssertInitialised()
{
if (!spTimers)
{
THROW_EXCEPTION(CommonException, TimersNotInitialised);
}
ASSERT(spTimers);
}

// --------------------------------------------------------------------------
//
// Function
Expand Down Expand Up @@ -340,7 +320,6 @@ void Timers::Reschedule()
// --------------------------------------------------------------------------
void Timers::SignalHandler(int unused)
{
// ASSERT(spTimers);
Timers::RequestReschedule();
}

Expand Down
1 change: 0 additions & 1 deletion lib/common/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Timers
public:
static void Init();
static void Cleanup(bool throw_exception_if_not_initialised = true);
static void AssertInitialised();
static void Add (Timer& rTimer);
static void Remove(Timer& rTimer);
static void RequestReschedule();
Expand Down
6 changes: 6 additions & 0 deletions lib/intercept/intercept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ extern "C" int
open(const char *path, int flags, ...)
#endif // DEFINE_ONLY_OPEN64
{
// Some newer architectures don't have an open() syscall, but use openat() instead.
// In these cases we will need to call sys_openat() instead of sys_open().
// https://chromium.googlesource.com/linux-syscall-support/

if(intercept_count > 0)
{
if(intercept_filename != NULL &&
Expand All @@ -264,6 +268,8 @@ extern "C" int

#ifdef PLATFORM_NO_SYSCALL
int r = TEST_open(path, flags, mode);
#elif HAVE_DECL_SYS_OPENAT && !HAVE_DECL_SYS_OPEN
int r = syscall(SYS_openat, AT_FDCWD, path, flags, mode);
#else
int r = syscall(SYS_open, path, flags, mode);
#endif
Expand Down
9 changes: 9 additions & 0 deletions lib/intercept/intercept.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,14 @@ void intercept_setup_stat_post_hook (lstat_post_hook_t hookfn);

void intercept_clear_setup();

// Some newer architectures don't have an open() syscall, but use openat() instead.
// In these cases we define SYS_open (which is otherwise undefined) to equal SYS_openat
// (which is defined) so that everywhere else we can call intercept_setup_error(SYS_open)
// without caring about the difference.
// https://chromium.googlesource.com/linux-syscall-support/
#if !HAVE_DECL_SYS_OPEN && HAVE_DECL_SYS_OPENAT
# define SYS_open SYS_openat
#endif

#endif // !PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE
#endif // !INTERCEPT_H
12 changes: 7 additions & 5 deletions test/common/testcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,16 +445,18 @@ bool test_timers()
// throws an assertion failure. Can only do this in debug mode
#ifndef BOX_RELEASE_BUILD
{
TEST_CHECK_THROWS(Timers::Cleanup(), CommonException,
AssertFailed);

Timer tim(0, "tim");
TEST_CHECK_THROWS(Timers::Add(tim), CommonException, AssertFailed);
Timers::Remove(tim);
}
#endif

// TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed);
#ifndef BOX_RELEASE_BUILD
TEST_CHECK_THROWS(Timers::Cleanup(), CommonException,
TEST_CHECK_THROWS(Timer t1(900, "t1"), CommonException,
AssertFailed);

// TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed);
}
#endif

// Check that we can initialise the timers
Expand Down
8 changes: 1 addition & 7 deletions test/raidfile/testraidfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "RaidFileException.h"
#include "RaidFileRead.h"
#include "Guards.h"
#include "intercept.h"

#include "MemLeakFindOn.h"

Expand All @@ -37,13 +38,6 @@
#define TRF_CAN_INTERCEPT
#endif

#ifdef TRF_CAN_INTERCEPT
// function in intercept.cpp for setting up errors
void intercept_setup_error(const char *filename, unsigned int errorafter, int errortoreturn, int syscalltoerror);
bool intercept_triggered();
void intercept_clear_setup();
#endif

// Nice random data for testing written files
class R250 {
public:
Expand Down

0 comments on commit c12f691

Please sign in to comment.