Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/mingw32] stdin redirection
@ 2007-04-19 12:26 Jerome Guitton
  2007-04-19 13:08 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Guitton @ 2007-04-19 12:26 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]


Related to this discussion:
http://sourceware.org/ml/gdb/2007-04/msg00063.html

It appeared that we should not use WaitForMultipleObjects on a file
handle. Here is a patch (inspired from the way GDB deals with pipes
on mingw32) to fix this issue.

OK to apply?


2007-04-19  Jerome Guitton  <guitton@adacore.com>

	* ser-mingw.c (fd_is_file): New function.
	(file_select_thread): New function.
	(ser_console_wait_handle): Add special handling for files.

[-- Attachment #2: ser-mingw.c.dif --]
[-- Type: video/dv, Size: 2512 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA/mingw32] stdin redirection
  2007-04-19 12:26 [RFA/mingw32] stdin redirection Jerome Guitton
@ 2007-04-19 13:08 ` Daniel Jacobowitz
  2007-04-19 14:16   ` Jerome Guitton
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-04-19 13:08 UTC (permalink / raw)
  To: Jerome Guitton; +Cc: gdb-patches

On Thu, Apr 19, 2007 at 02:20:08PM +0200, Jerome Guitton wrote:
> +  if (GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_DISK)

Hey neat, I didn't know that was there.

> +      SetEvent (state->read_event);
> +      continue;
> +
> +      /* Delay 10ms before checking again, but allow the stop event
> +	 to wake us.  */
> +      if (WaitForSingleObject (state->stop_select, 10) == WAIT_OBJECT_0)
> +	continue;
> +
> +      goto retry;

I assume you meant to delete the code at the bottom and the retry
label.  OK with that change.


-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA/mingw32] stdin redirection
  2007-04-19 13:08 ` Daniel Jacobowitz
@ 2007-04-19 14:16   ` Jerome Guitton
  0 siblings, 0 replies; 3+ messages in thread
From: Jerome Guitton @ 2007-04-19 14:16 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

Daniel Jacobowitz (drow@false.org):

> I assume you meant to delete the code at the bottom and the retry
> label.  OK with that change.

Right, thanks. Applied (final patch in attachement).

[-- Attachment #2: ser-mingw.c.dif --]
[-- Type: video/dv, Size: 2758 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-19 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-19 12:26 [RFA/mingw32] stdin redirection Jerome Guitton
2007-04-19 13:08 ` Daniel Jacobowitz
2007-04-19 14:16   ` Jerome Guitton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox