Skip to content
Permalink
Browse files

conditional waitpid() for WIN

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5200 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Apr 6, 2006
1 parent 56329d2 commit 336dc014f0d7f8bfd6504fb5fa341821582b839b
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/plugins/grass/qgsgrassshell.cpp
@@ -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;

0 comments on commit 336dc01

Please sign in to comment.
You can’t perform that action at this time.