Permalink
Browse files

Add status bar warning if Windows spawn timed out

  • Loading branch information...
1 parent deb5f35 commit 8d26450f07cac40812a04fe2adfd29fa54f25059 @ntrel ntrel committed Jul 8, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/win32.c
View
@@ -1093,10 +1093,15 @@ static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline
else
{
gint i;
+ gsize ms = 30*1000;
- for (i = 0; i < 2 && WaitForSingleObject(piProcInfo.hProcess, 30*1000) == WAIT_TIMEOUT; i++)
+ /* FIXME: this seems to timeout when there are many lines
+ * to read - maybe because the child's pipe is full */
+ for (i = 0; i < 2 &&
+ WaitForSingleObject(piProcInfo.hProcess, ms) == WAIT_TIMEOUT; i++)
{
- geany_debug("CreateChildProcess: CreateProcess failed");
+ ui_set_statusbar(FALSE, _("Process timed out after %.02f s!"), ms / 1000.0F);
+ geany_debug("CreateChildProcess: timed out");
TerminateProcess(piProcInfo.hProcess, WAIT_TIMEOUT); /* NOTE: This will not kill grandkids. */
}

0 comments on commit 8d26450

Please sign in to comment.