aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <p.jaroszynski@gmail.com> 2009-09-06 18:35:56 +0000
committerAvatar Piotr Jaroszyński <p.jaroszynski@gmail.com> 2009-09-06 18:38:37 +0000
commit8939f5a4b07bd4f1fe044d4bb7b6a48c7c76097c (patch)
treee22900b9b15c3d31dfb0e07eaaf7fd2b9f969612
parentffb4bca6dab60828ec261dc8f0dc187250e69c1b (diff)
downloadpaludis-8939f5a4b07bd4f1fe044d4bb7b6a48c7c76097c.tar.gz
paludis-8939f5a4b07bd4f1fe044d4bb7b6a48c7c76097c.tar.xz
Really use ptsname_r when available.
-rw-r--r--paludis/util/pty.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/paludis/util/pty.cc b/paludis/util/pty.cc
index 603a85a..7973456 100644
--- a/paludis/util/pty.cc
+++ b/paludis/util/pty.cc
@@ -25,6 +25,11 @@
#include <fcntl.h>
#include <errno.h>
#include <cstring>
+#include "config.h"
+
+#ifdef HAVE_PTSNAME_R
+# include <vector>
+#endif
using namespace paludis;
@@ -54,10 +59,10 @@ Pty::Pty()
#ifdef HAVE_PTSNAME_R
std::vector<char> name;
name.resize(16);
- while (-1 == ptsname_r(_fds[0], &name[0], name.length()))
+ while (-1 == ptsname_r(_fds[0], &name[0], name.size()))
{
if (ERANGE == errno)
- name.resize(name.length() * 2);
+ name.resize(name.size() * 2);
else
{
close(_fds[0]);