mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
Building supervisor for window
This commit is contained in:
parent
3a80b79497
commit
0dbfd9b04e
2 changed files with 15 additions and 13 deletions
14
src/Val.h
14
src/Val.h
|
@ -1124,15 +1124,19 @@ public:
|
||||||
AddedField(field);
|
AddedField(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Assign(int field, int new_val)
|
// For int types, we provide both [u]int32_t and [u]int64_t versions
|
||||||
|
// for convenience, since sometimes the caller has one rather
|
||||||
|
// than the other.
|
||||||
|
void Assign(int field, int32_t new_val)
|
||||||
|
{
|
||||||
|
(*record_val)[field] = ZVal(zeek_int_t(new_val));
|
||||||
|
AddedField(field);
|
||||||
|
}
|
||||||
|
void Assign(int field, int64_t new_val)
|
||||||
{
|
{
|
||||||
(*record_val)[field] = ZVal(zeek_int_t(new_val));
|
(*record_val)[field] = ZVal(zeek_int_t(new_val));
|
||||||
AddedField(field);
|
AddedField(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For unsigned, we provide both uint32_t and uint64_t versions
|
|
||||||
// for convenience, since sometimes the caller has one rather
|
|
||||||
// than the other.
|
|
||||||
void Assign(int field, uint32_t new_val)
|
void Assign(int field, uint32_t new_val)
|
||||||
{
|
{
|
||||||
(*record_val)[field] = ZVal(zeek_uint_t(new_val));
|
(*record_val)[field] = ZVal(zeek_uint_t(new_val));
|
||||||
|
|
|
@ -987,25 +987,23 @@ std::optional<SupervisedNode> Stem::Poll()
|
||||||
const auto total_fd_count = fixed_fd_count + (nodes.size() * 2);
|
const auto total_fd_count = fixed_fd_count + (nodes.size() * 2);
|
||||||
auto pfds = std::make_unique<pollfd[]>(total_fd_count);
|
auto pfds = std::make_unique<pollfd[]>(total_fd_count);
|
||||||
int pfd_idx = 0;
|
int pfd_idx = 0;
|
||||||
pfds[pfd_idx++] = {pipe->InFD(), POLLIN, 0};
|
pfds[pfd_idx++] = {static_cast<decltype(pollfd::fd)>(pipe->InFD()), POLLIN, 0};
|
||||||
pfds[pfd_idx++] = {signal_flare->FD(), POLLIN, 0};
|
pfds[pfd_idx++] = {static_cast<decltype(pollfd::fd)>(signal_flare->FD()), POLLIN, 0};
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
|
||||||
for ( const auto& [name, node] : nodes )
|
for ( const auto& [name, node] : nodes )
|
||||||
{
|
{
|
||||||
node_pollfd_indices[name] = pfd_idx;
|
node_pollfd_indices[name] = pfd_idx;
|
||||||
|
|
||||||
if ( node.stdout_pipe.pipe )
|
if ( node.stdout_pipe.pipe )
|
||||||
pfds[pfd_idx++] = {node.stdout_pipe.pipe->ReadFD(), POLLIN, 0};
|
pfds[pfd_idx++] = {static_cast<decltype(pollfd::fd)>(node.stdout_pipe.pipe->ReadFD()), POLLIN, 0};
|
||||||
else
|
else
|
||||||
pfds[pfd_idx++] = {-1, POLLIN, 0};
|
pfds[pfd_idx++] = {static_cast<decltype(pollfd::fd)>(-1), POLLIN, 0};
|
||||||
|
|
||||||
if ( node.stderr_pipe.pipe )
|
if ( node.stderr_pipe.pipe )
|
||||||
pfds[pfd_idx++] = {node.stderr_pipe.pipe->ReadFD(), POLLIN, 0};
|
pfds[pfd_idx++] = {static_cast<decltype(pollfd::fd)>(node.stderr_pipe.pipe->ReadFD()), POLLIN, 0};
|
||||||
else
|
else
|
||||||
pfds[pfd_idx++] = {-1, POLLIN, 0};
|
pfds[pfd_idx++] = {static_cast<decltype(pollfd::fd)>(-1), POLLIN, 0};
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Note: the poll timeout here is for periodically checking if the parent
|
// Note: the poll timeout here is for periodically checking if the parent
|
||||||
// process died (see below).
|
// process died (see below).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue