Updating tests for the #start/#end change.

This commit is contained in:
Robin Sommer 2012-07-19 18:57:15 -07:00
parent 87e10b5f97
commit 5cfb8d65c3
123 changed files with 442 additions and 162 deletions

View file

@ -93,9 +93,11 @@ const char* BasicThread::Fmt(const char* format, ...)
const char* BasicThread::Strerror(int err)
{
static char buf[128] = "<not set>";
strerror_r(err, buf, sizeof(buf));
return buf;
if ( ! strerr_buffer )
strerr_buffer = new char[256];
strerror_r(err, strerr_buffer, 256);
return strerr_buffer;
}
void BasicThread::Start()

View file

@ -120,8 +120,8 @@ public:
/**
* A version of strerror() that the thread can safely use. This is
* essentially a wrapper around strerror_r(). Note that it keeps a
* single static buffer internally so the result remains valid only
* until the next call.
* single buffer per thread internally so the result remains valid
* only until the next call.
*/
const char* Strerror(int err);
@ -207,6 +207,9 @@ private:
char* buf;
unsigned int buf_len;
// For implementating Strerror().
char* strerr_buffer;
static uint64_t thread_counter;
};

View file

@ -5,6 +5,7 @@
#include "Manager.h"
#include <unistd.h>
#include <signal.h>
using namespace threading;