Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
conditional waitpid() for WIN
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5200 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Apr 6, 2006
1 parent 56329d2 commit 336dc01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugins/grass/qgsgrassshell.cpp
Expand Up @@ -250,19 +250,22 @@ QgsGrassShell::~QgsGrassShell()
// TODO: find signal to write history before exit
// instead of sending 'exit'

int ret = write( mFdMaster, "exit\015\012", 6);
int status;
write( mFdMaster, "exit\015\012", 6);

#ifndef WIN32
while ( 1 )
{
readStdout(0);

int status;
if ( waitpid ( mPid, &status, WNOHANG ) > 0 ) break;

struct timespec t, r;
t.tv_sec = 0;
t.tv_nsec = 10000000; // 0.01 s
nanosleep ( &t, &r );
}
#endif

/*
std::cerr << "kill shell pid = " << mPid << std::endl;
Expand Down

0 comments on commit 336dc01

Please sign in to comment.