mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Merge branch 'topic/robin/master-test'
* topic/robin/master-test: (60 commits) Script fix for Linux. Updating test base line. Another small change to MsgThread API. Bug fix for BasicThread. make version_ok return true for TLSv12 Sed usage in canonifier script didn't work on non-Linux systems. Changing HTTP DPD port 3138 to 3128. Temporarily removing tuning/logs-to-elasticsearch.bro from the test-all-policy. More documentation updates. Revert "Fixing calc_next_rotate to use UTC based time functions." Some documentation updates for elasticsearch plugin. Give configure a --disable-perftools option. Updating tests for the #start/#end change. Further threading and API restructuring for logging and input frameworks. Reworking forceful thread termination. Moving the ASCII writer over to use UNIX I/O rather than stdio. Further reworking the thread API. Reworking thread termination logic. If a thread doesn't terminate, we log that but not longer proceed (because it could hang later still). Removing the thread kill functionality. ...
This commit is contained in:
commit
24aea295fa
176 changed files with 2238 additions and 771 deletions
24
src/util.cc
24
src/util.cc
|
@ -1290,6 +1290,30 @@ uint64 calculate_unique_id(size_t pool)
|
|||
return HashKey::HashBytes(&(uid_pool[pool].key), sizeof(uid_pool[pool].key));
|
||||
}
|
||||
|
||||
bool safe_write(int fd, const char* data, int len)
|
||||
{
|
||||
while ( len > 0 )
|
||||
{
|
||||
int n = write(fd, data, len);
|
||||
|
||||
if ( n < 0 )
|
||||
{
|
||||
if ( errno == EINTR )
|
||||
continue;
|
||||
|
||||
fprintf(stderr, "safe_write error: %d\n", errno);
|
||||
abort();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
data += n;
|
||||
len -= n;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void out_of_memory(const char* where)
|
||||
{
|
||||
reporter->FatalError("out of memory in %s.\n", where);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue