diff --git a/common/include/villas/popen.hpp b/common/include/villas/popen.hpp index 5f72489b6..ba1c8ba63 100644 --- a/common/include/villas/popen.hpp +++ b/common/include/villas/popen.hpp @@ -48,21 +48,26 @@ public: int close(); void kill(int signal = SIGINT); - std::istream &in() + std::istream &cin() { return *(input.stream); } - std::ostream &out() + std::ostream &cout() { return *(output.stream); } - int fd() + int getFd() { return input.buffer->fd(); } + pid_t getPid() const + { + return pid; + } + protected: std::string command; pid_t pid; diff --git a/common/tests/unit/popen.cpp b/common/tests/unit/popen.cpp index d3ef7d30e..22d41c85b 100644 --- a/common/tests/unit/popen.cpp +++ b/common/tests/unit/popen.cpp @@ -33,12 +33,12 @@ Test(popen, cat) { Popen proc("cat"); - proc.out() << "Hello World" << std::endl; - proc.out().flush(); + proc.cout() << "Hello World" << std::endl; + proc.cout().flush(); std::string str, str2; - proc.in() >> str >> str2; + proc.cin() >> str >> str2; cr_assert_eq(str, "Hello"); cr_assert_eq(str2, "World");