summaryrefslogtreecommitdiff
path: root/src/shell_manager.cc
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2015-12-10 11:00:10 +0300
committerFrank LENORMAND <lenormf@gmail.com>2015-12-10 11:00:10 +0300
commitdf31b88187bc1e262abbeddc63c6cde6331bf07a (patch)
treec2c20df6a0382de5f97d77ff9606cef22b48f712 /src/shell_manager.cc
parent2ca1784495f1497b7d93cd0401244ad7d3bcc900 (diff)
Fix "unused result" warnings for several system calls.
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]; }