wait4pid(pid_t child, waitstatus *status)
{
pid_t wait_pid = 0;
+ long delay_msec = 1;
while (wait_pid != child)
{
# endif
if (wait_pid == 0)
{
- /* Wait for 10 msec before trying again. */
- mch_delay(10L, TRUE);
+ /* Wait for 1 to 10 msec before trying again. */
+ mch_delay(delay_msec, TRUE);
+ if (++delay_msec > 10)
+ delay_msec = 10;
continue;
}
if (wait_pid <= 0
# if defined(FEAT_XCLIPBOARD) && defined(FEAT_X11)
else
{
+ long delay_msec = 1;
+
/*
* Similar to the loop above, but only handle X events, no
* I/O.
/* Handle any X events, e.g. serving the clipboard. */
clip_update();
- mch_delay(10L, TRUE);
+ /* Wait for 1 to 10 msec. 1 is faster but gives the child
+ * less time. */
+ mch_delay(delay_msec, TRUE);
+ if (++delay_msec > 10)
+ delay_msec = 10;
}
}
# endif