From 4248362010960c4f737cd7bb19902150042f4583 Mon Sep 17 00:00:00 2001 From: cgf Date: Sun, 28 Jun 2009 18:23:35 +0000 Subject: [PATCH] * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing spaces. * cygwin.din: Add long-needed comment describing what dll_crt0__FP11per_process demangles to. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/cygwin.din | 2 +- winsup/cygwin/fhandler.cc | 8 +------- winsup/cygwin/gendef | 13 ++++++++----- winsup/cygwin/select.cc | 4 ++++ 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f05d2c76a5..b5197b6dee 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2009-06-28 Christopher Faylor + + * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing + spaces. + * cygwin.din: Add long-needed comment describing what + dll_crt0__FP11per_process demangles to. + 2009-06-26 Corinna Vinschen * wincap.h (wincaps::has_broken_alloc_console): New element. diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din index 8ccafd415a..83b9d0fe62 100644 --- a/winsup/cygwin/cygwin.din +++ b/winsup/cygwin/cygwin.din @@ -273,7 +273,7 @@ dlclose SIGFE dlerror NOSIGFE dlfork NOSIGFE _dll_crt0@0 NOSIGFE -dll_crt0__FP11per_process NOSIGFE +dll_crt0__FP11per_process NOSIGFE # dll_crt0(per_process *) dll_dllcrt0 NOSIGFE dll_entry@12 NOSIGFE dll_noncygwin_dllcrt0 NOSIGFE diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index b8aa0dd800..da656ce287 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1652,7 +1652,7 @@ fhandler_base::setup_overlapped (bool doit) if (doit) { set_overlapped (ov); - res = !!(ov->hEvent = CreateEvent (&sec_none_nih, true, false, NULL)); + res = !!(ov->hEvent = CreateEvent (&sec_none_nih, true, true, NULL)); } else { @@ -1758,12 +1758,6 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes, DWORD le debug_printf ("EOF"); } - /* Make sure the event is unsignalled (this is a potential race in a multi-threaded - app. Sigh.). Must do this after WFMO and GetOverlappedResult or suffer - occasional sporadic problems: - http://cygwin.com/ml/cygwin/2008-08/msg00511.html */ - if (err != ERROR_IO_PENDING) - ResetEvent (get_overlapped ()->hEvent); if (writing && (err == ERROR_NO_DATA || err == ERROR_BROKEN_PIPE)) raise (SIGPIPE); return res; diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index 7c17a11ee8..9c17010b4a 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -8,7 +8,8 @@ # details. # use strict; -sub nocr(@); +sub cleanup(@); + my $in = shift; my $tls_offsets = shift; my $out = shift; @@ -24,11 +25,11 @@ require $tls_offsets; open(IN, $in) or die "$0: couldn't open \"$in\" - $!\n"; my @top = (); while () { - push(@top, nocr $_); + push(@top, cleanup $_); last if /^\s*exports\s*$/i; } -my $libline = nocr scalar(); -my @in = nocr ; +my $libline = cleanup scalar(); +my @in = cleanup ; close(IN); my %sigfe = (); @@ -456,6 +457,8 @@ _longjmp: EOF } -sub nocr(@) { +sub cleanup(@) { map {s/\r//g; $_} @_; + map {s/#.*//g; $_} @_; + map {s/[ \t]+$//g; $_} @_; } diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 747444884b..c3dc0055b0 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -513,6 +513,10 @@ out: else if (fh->get_device () == FH_PIPER) select_printf ("%s, select for write on read end of pipe", fh->get_name ()); + else if (fh->get_overlapped ()->hEvent + && WaitForSingleObject (fh->get_overlapped ()->hEvent, 0) + != WAIT_OBJECT_0) + s->write_ready = false; else { #if 0 -- 2.11.0