summaryrefslogtreecommitdiff
path: root/src/shell_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shell_manager.cc')
-rw-r--r--src/shell_manager.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shell_manager.cc b/src/shell_manager.cc
index 2d98298e..d8ae6d78 100644
--- a/src/shell_manager.cc
+++ b/src/shell_manager.cc
@@ -29,7 +29,10 @@ namespace
struct Pipe
{
- Pipe() { ::pipe(m_fd); }
+ Pipe() {
+ if (::pipe(m_fd) < 0)
+ throw runtime_error(format("unable to create pipe (fds: {}/{}; errno: {})", m_fd[0], m_fd[1], ::strerror(errno)));
+ }
~Pipe() { close_read_fd(); close_write_fd(); }
int read_fd() const { return m_fd[0]; }