checkX problems

Mike Ayers
Fri Nov 13 21:11:00 GMT 2009

> From: [mailto:cygwin-xfree-
>] On Behalf Of Lothar Brendel

> Could you please clarify an issue here? (Sorry, it seems, I wronged to
> ``run'' in the previous posts.)
> In a Windows command prompt (being somewhere on C:) I put the line
>         \cygwin\bin\run -p /usr/bin sleep -wait 5
> into a file ``dosleep.bat''. Executing that BAT-script (w/o any
> wrapper), it
> *does* sleep. Typing that very line directly at the prompt lets ``run''
> return immediately, though. Can you confirm this behaviour?

	I can confirm that without testing (so I'm probably chomping foot here...).  The sleep is holding the console open after run quits. This comes under the "console programs must have a console" heading.  It takes a bit ti get used to, but you'll get it soon.

> >> Looking forward to reading your patches to address any of these
> >> problems.
> >
> > It shouldn't be too hard to add an option to checkX to make it
> "retry"
> > if ECONNREFUSED. This would have to manually track the elapsed time
> > for each attempt, charging against the specified -t <waittime>.
> Another possibility would be an option ``-n'' to specify the number of
> retries.

	GAH!  No, that's just lame.  Just spawn/fork a sleep-then-interrupt-daddy thread/process, set up a SIGINT handler that exits with an error, loop connection attempts until successful, check X, kill child, exit with success.  That enforces both types of timeout.



More information about the Cygwin-xfree mailing list