Skip to content

Commit

Permalink
switch to std fflush
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Apr 29, 2022
1 parent e029e76 commit 4f21707
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/benchmarks/io/cuio_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <benchmarks/io/cuio_common.hpp>

#include <cstdio>
#include <fstream>
#include <numeric>
#include <string>
Expand Down Expand Up @@ -146,7 +147,7 @@ std::vector<cudf::size_type> segments_in_chunk(int num_segments, int num_chunks,
std::string exec_cmd(std::string_view cmd)
{
// Prevent the output from the command from mixing with the original process' output
fflush(nullptr);
std::fflush(nullptr);
// Switch stderr and stdout to only capture stderr
auto const redirected_cmd = std::string{"( "}.append(cmd).append(" 3>&2 2>&1 1>&3) 2>/dev/null");
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(redirected_cmd.c_str(), "r"), pclose);
Expand Down

0 comments on commit 4f21707

Please sign in to comment.