mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Updating tests for the #start/#end change.
This commit is contained in:
parent
87e10b5f97
commit
5cfb8d65c3
123 changed files with 442 additions and 162 deletions
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "Manager.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
using namespace threading;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue