Skip to content

Commit

Permalink
fix compil gcc 13
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Sep 13, 2024
1 parent 545e6a6 commit 587647e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Yann/ExcludeSats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ std::string execCmdOutput(const char* cmd) {

std::array<char, 128> buffer;
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);

struct PipeCloser {
void operator()(FILE *p) const { pclose(p); }
};

std::unique_ptr<FILE, PipeCloser> pipe(popen(cmd, "r"));
if (!pipe) {
throw std::runtime_error("popen() failed!");
}
Expand Down

0 comments on commit 587647e

Please sign in to comment.