Skip to content

Commit 2db0e76

Browse files
authored
Try new solution
1 parent ae3268b commit 2db0e76

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/Interpreter/CppInterOp.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,14 +2828,15 @@ namespace Cpp {
28282828
#define DEBUG_TYPE "exec"
28292829

28302830
std::array<char, 256> buffer;
2831-
struct file_deleter
2832-
{
2833-
void operator()(std::FILE* fp)
2834-
{
2835-
pclose(fp);
2836-
}
2837-
};
2838-
std::unique_ptr<FILE, file_deleter> pipe(popen(cmd, "r"), pclose);
2831+
struct file_deleter
2832+
{
2833+
void operator()(std::FILE* fp)
2834+
{
2835+
pclose(fp);
2836+
}
2837+
};
2838+
using unique_file = std::unique_ptr<std::FILE, file_deleter>;
2839+
unique_file pipe(popen(cmd, "r"), pclose);
28392840
LLVM_DEBUG(dbgs() << "Executing command '" << cmd << "'\n");
28402841

28412842
if (!pipe) {

0 commit comments

Comments
 (0)