aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2014-02-03 20:32:31 +0100
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2015-04-26 21:18:27 +0100
commit092d6b1323fce831f60bee5f5c7f0be9b2c3aadb (patch)
treeb6ecca15f150812662cf89b8e666056d1143c80c
parent979b883807c49ac2dd3e1c2dfcd1ad3e02c29217 (diff)
downloadpaludis-092d6b1323fce831f60bee5f5c7f0be9b2c3aadb.tar.gz
paludis-092d6b1323fce831f60bee5f5c7f0be9b2c3aadb.tar.xz
Use a delegating constructor for Pty
Part of C++11 and supported since gcc 4.7 Delegating constructors N1986 GCC 4.7 https://gcc.gnu.org/projects/cxx0x.html Change-Id: I0bf4e02aa9f672a2c235004bf9e8983d6c90ef39
-rw-r--r--paludis/util/pty.cc9
-rw-r--r--paludis/util/pty.hh3
2 files changed, 1 insertions, 11 deletions
diff --git a/paludis/util/pty.cc b/paludis/util/pty.cc
index 68c2c2e..d39b128 100644
--- a/paludis/util/pty.cc
+++ b/paludis/util/pty.cc
@@ -40,19 +40,12 @@ PtyError::PtyError(const std::string & our_message) throw () :
{
}
-Pty::Pty()
+Pty::Pty() : Pty(false, 0, 0)
{
- _init(false, 0, 0);
}
Pty::Pty(const bool close_exec, const unsigned short columns, const unsigned short lines)
{
- _init(close_exec, columns, lines);
-}
-
-void
-Pty::_init(const bool close_exec, const unsigned short columns, const unsigned short lines)
-{
Context context("When creating pty FDs:");
_fds[0] = posix_openpt(O_RDWR | O_NOCTTY | (close_exec ? O_CLOEXEC : 0));
diff --git a/paludis/util/pty.hh b/paludis/util/pty.hh
index 58d7485..71877c6 100644
--- a/paludis/util/pty.hh
+++ b/paludis/util/pty.hh
@@ -64,9 +64,6 @@ namespace paludis
class PALUDIS_VISIBLE Pty :
public Channel
{
- private:
- void _init(const bool, const unsigned short columns, const unsigned short lines);
-
public:
///\name Basic operations
///\{