Skip to content

Commit

Permalink
quick fix to get grass shell built on mac
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10668 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 27, 2009
1 parent 0e6cca3 commit df56940
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/grass/qtermwidget/k3process.cpp
Expand Up @@ -636,8 +636,10 @@ bool K3Process::closeStderr()
bool K3Process::closePty()
{
if (d->pty && d->pty->masterFd() >= 0) {
#ifndef Q_OS_MAC
if (d->addUtmp)
d->pty->logout();
#endif
d->pty->close();
return true;
} else
Expand Down Expand Up @@ -948,8 +950,10 @@ int K3Process::commSetupDoneC()
// PTY stuff //
if (d->usePty) {
d->pty->setCTty();
#ifndef Q_OS_MAC
if (d->addUtmp)
d->pty->login(getenv("USER"), getenv("DISPLAY"));
#endif
}

return ok;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/grass/qtermwidget/kpty.cpp
Expand Up @@ -417,6 +417,7 @@ void KPty::setCTty()
#endif
}

#ifndef Q_OS_MAC
void KPty::login(const char *user, const char *remotehost)
{
#ifdef HAVE_UTEMPTER
Expand Down Expand Up @@ -561,6 +562,7 @@ void KPty::logout()
# endif
#endif
}
#endif

// XXX Supposedly, tc[gs]etattr do not work with the master on Solaris.
// Please verify.
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/grass/qtermwidget/kpty.h
Expand Up @@ -82,6 +82,7 @@ class KPty {
*/
void setCTty();

#ifndef Q_OS_MAC
/**
* Creates an utmp entry for the tty.
* This function must be called after calling setCTty and
Expand All @@ -98,6 +99,7 @@ class KPty {
* Removes the utmp entry for this tty.
*/
void logout();
#endif

/**
* Wrapper around tcgetattr(3).
Expand Down

0 comments on commit df56940

Please sign in to comment.