Skip to content

Commit 336dc01

Browse files
author
rblazek
committed
conditional waitpid() for WIN
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5200 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 56329d2 commit 336dc01

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/plugins/grass/qgsgrassshell.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,19 +250,22 @@ QgsGrassShell::~QgsGrassShell()
250250
// TODO: find signal to write history before exit
251251
// instead of sending 'exit'
252252

253-
int ret = write( mFdMaster, "exit\015\012", 6);
254-
int status;
253+
write( mFdMaster, "exit\015\012", 6);
255254

255+
#ifndef WIN32
256256
while ( 1 )
257257
{
258258
readStdout(0);
259+
260+
int status;
259261
if ( waitpid ( mPid, &status, WNOHANG ) > 0 ) break;
260262

261263
struct timespec t, r;
262264
t.tv_sec = 0;
263265
t.tv_nsec = 10000000; // 0.01 s
264266
nanosleep ( &t, &r );
265267
}
268+
#endif
266269

267270
/*
268271
std::cerr << "kill shell pid = " << mPid << std::endl;

0 commit comments

Comments
 (0)