[Konsole-devel] [Bug 87481] Konsole freezes on startup when unable to allocate PTY
Kurt V.Hindenburg
kurt.hindenburg at kdemail.net
Wed Apr 6 15:38:15 UTC 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=87481
kurt.hindenburg kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From kurt.hindenburg kdemail net 2005-04-06 17:38 -------
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);
More information about the konsole-devel
mailing list