Skip to content

Commit

Permalink
fix(userspace/falco): disable program_output on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Oct 25, 2023
1 parent 52fe402 commit 84a94d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions userspace/falco/falco_outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ void falco_outputs::add_output(falco::outputs::config oc)
{
oo = new falco::outputs::output_file();
}
#ifndef _WIN32
else if(oc.name == "program")
{
oo = new falco::outputs::output_program();
}
#endif
else if(oc.name == "stdout")
{
oo = new falco::outputs::output_stdout();
Expand Down
4 changes: 4 additions & 0 deletions userspace/falco/outputs_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.

void falco::outputs::output_program::open_pfile()
{
#ifndef _WIN32
if(m_pfile == nullptr)
{
m_pfile = popen(m_oc.options["program"].c_str(), "w");
Expand All @@ -29,6 +30,7 @@ void falco::outputs::output_program::open_pfile()
setvbuf(m_pfile, NULL, _IONBF, 0);
}
}
#endif
}

void falco::outputs::output_program::output(const message *msg)
Expand All @@ -45,11 +47,13 @@ void falco::outputs::output_program::output(const message *msg)

void falco::outputs::output_program::cleanup()
{
#ifndef _WIN32
if(m_pfile != nullptr)
{
pclose(m_pfile);
m_pfile = nullptr;
}
#endif
}

void falco::outputs::output_program::reopen()
Expand Down

0 comments on commit 84a94d8

Please sign in to comment.