[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/konsole/konsole
From:       Kurt Hindenburg <kurt.hindenburg () kdemail ! net>
Date:       2005-04-06 15:38:00
Message-ID: 20050406153800.A8F3263E () office ! kde ! org
[Download RAW message or body]

CVS commit by hindenburg: 

Exit somewhat gracefully when unable to allocate a PTY.

BUG: 87481


  M +1 -1      TEPty.cpp   1.89
  M +11 -2     session.cpp   1.102


--- kdebase/konsole/konsole/TEPty.cpp  #1.88:1.89
@@ -123,5 +123,5 @@ int TEPty::run(const char* _pgm, QStrLis
   setUsePty(All, _addutmp);
 
-  if (!start(NotifyOnExit, (Communication) (Stdin | Stdout)))
+  if ( start(NotifyOnExit, (Communication) (Stdin | Stdout)) == false )
      return -1;
 

--- kdebase/konsole/konsole/session.cpp  #1.101:1.102
@@ -97,4 +97,7 @@ TESession::TESession(TEWidget* _te, cons
 void TESession::ptyError()
 {
+  if ( sh->error().isEmpty() )
+    KMessageBox::error(te->topLevelWidget(), i18n("Unable to allocate a pseudo teletype!"));
+  else
   KMessageBox::error(te->topLevelWidget(), sh->error());
   emit done(this);
@@ -131,7 +134,13 @@ void TESession::run()
      QDir::setCurrent(initial_cwd);
   sh->setXonXoff(xon_xoff);
-  sh->run(QFile::encodeName(pgm), args, term.latin1(), winId, add_to_utmp,
+
+  int result = sh->run(QFile::encodeName(pgm), args, term.latin1(), 
+          winId, add_to_utmp,
           ("DCOPRef("+appId+",konsole)").latin1(),
           ("DCOPRef("+appId+","+sessionId+")").latin1());
+  if (result < 0) {     // Error in creating pseudo teletype
+    kdWarning()<<"Unable to allocate a pseudo teletype!"<<endl;
+    QTimer::singleShot(0, this, SLOT(ptyError()));
+  }
   if (!initial_cwd.isEmpty())
      QDir::setCurrent(cwd_save);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic