[nemiver] Terminal portability fixes for BSDs
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver] Terminal portability fixes for BSDs
- Date: Sat, 23 Jun 2012 13:39:53 +0000 (UTC)
commit bdf80c97eb216743c1702de5d6e710df0887e9c1
Author: Antoine Jacoutot <ajacoutot gnome org>
Date: Thu Jun 21 18:58:04 2012 +0200
Terminal portability fixes for BSDs
* src/uicommon/nmv-terminal.cc (Terminal::Priv::init_pty):
Don't call useless grantpt and unlockpt.
(Terminal::slave_pts_name): use POSIX call ttyname in lieu of
the non-portable ptsname.
src/uicommon/nmv-terminal.cc | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/src/uicommon/nmv-terminal.cc b/src/uicommon/nmv-terminal.cc
index 9eb0095..e925f67 100644
--- a/src/uicommon/nmv-terminal.cc
+++ b/src/uicommon/nmv-terminal.cc
@@ -263,16 +263,6 @@ struct Terminal::Priv {
THROW_IF_FAIL (slave_pty);
THROW_IF_FAIL (master_pty);
- if (grantpt (master_pty)) {
- LOG_ERROR ("oops");
- return false;
- }
-
- if (unlockpt (master_pty)) {
- LOG_ERROR ("oops");
- return false;
- }
-
vte_terminal_set_pty (vte, master_pty);
return true;
}
@@ -311,12 +301,12 @@ Terminal::slave_pts_name () const
THROW_IF_FAIL (m_priv);
UString result;
- if (!m_priv->master_pty) {
+ if (!m_priv->slave_pty) {
LOG_ERROR ("oops");
return result;
}
- result = ptsname (m_priv->master_pty);
+ result = ttyname (m_priv->slave_pty);
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]