Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-06-07 22:41:31 +0400
committerChristopher Faylor <me@cgf.cx>2005-06-07 22:41:31 +0400
commitb739751db982170d8e10caa720e5c6a5a1918f37 (patch)
tree42c773457d8aeecd5fd6a06e076da04410f0d38b
parent7066fc51d74c0a9e3b85350617e889db92816d59 (diff)
* cygthread.cc (cygthread::detach): Make error message a little more detailed.
* fhandler.cc (fhandler_base::raw_read): Ditto for debug message. * dcrt0.cc (do_exit): Add some more synchronization tests. * fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent handle. Use derived return value rather than always retuning 0. * fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet. * winsup.h (exit_states): Add a couple of new exit states.
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/cygthread.cc2
-rw-r--r--winsup/cygwin/dcrt0.cc14
-rw-r--r--winsup/cygwin/fhandler.cc2
-rw-r--r--winsup/cygwin/fhandler_fifo.cc9
-rw-r--r--winsup/cygwin/fhandler_netdrive.cc2
-rw-r--r--winsup/cygwin/winsup.h2
7 files changed, 33 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 902b96f37..16a2307d5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,14 @@
+2005-06-07 Christopher Faylor <cgf@timesys.com>
+
+ * cygthread.cc (cygthread::detach): Make error message a little more
+ detailed.
+ * fhandler.cc (fhandler_base::raw_read): Ditto for debug message.
+ * dcrt0.cc (do_exit): Add some more synchronization tests.
+ * fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent
+ handle. Use derived return value rather than always retuning 0.
+ * fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet.
+ * winsup.h (exit_states): Add a couple of new exit states.
+
2005-06-06 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): If GetFileAttributes returns
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index d032b0f07..af60abf2a 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -344,7 +344,7 @@ cygthread::detach (HANDLE sigwait)
break;
default:
if (!exiting)
- api_fatal ("WFMO failed waiting for cygthread '%s'", __name);
+ api_fatal ("WFMO failed waiting for cygthread '%s', %E", __name);
break;
}
/* WAIT_OBJECT_0 means that the thread successfully read something,
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 457661000..ea0edbd0c 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -1013,8 +1013,18 @@ do_exit (int status)
#endif
EnterCriticalSection (&exit_lock);
- muto::set_exiting_thread ();
- dll_global_dtors ();
+
+ if (exit_state < ES_SET_MUTO)
+ {
+ exit_state = ES_SET_MUTO;
+ muto::set_exiting_thread ();
+ }
+
+ if (exit_state < ES_GLOBAL_DTORS)
+ {
+ exit_state = ES_GLOBAL_DTORS;
+ dll_global_dtors ();
+ }
if (exit_state < ES_EVENTS_TERMINATE)
{
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 6c0eaec38..c5074a3fe 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -269,7 +269,7 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
break;
}
default:
- syscall_printf ("ReadFile %s failed, %E", get_name ());
+ syscall_printf ("ReadFile %s(%p) failed, %E", get_name (), get_handle ());
__seterrno_from_win_error (errcode);
bytes_read = (size_t) -1;
break;
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 4ff94bb4e..742b70c10 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -184,14 +184,15 @@ fhandler_fifo::dup (fhandler_base *child)
if (!res)
{
fhandler_fifo *ff = (fhandler_fifo *) child;
- if (!DuplicateHandle (hMainProc, get_output_handle (), hMainProc,
- &ff->get_output_handle (), false, true,
- DUPLICATE_SAME_ACCESS))
+ if (get_output_handle ()
+ && !DuplicateHandle (hMainProc, get_output_handle (), hMainProc,
+ &ff->get_output_handle (), false, true,
+ DUPLICATE_SAME_ACCESS))
{
__seterrno ();
child->close ();
res = -1;
}
}
- return 0;
+ return res;
}
diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc
index bad6b491c..8249673be 100644
--- a/winsup/cygwin/fhandler_netdrive.cc
+++ b/winsup/cygwin/fhandler_netdrive.cc
@@ -123,7 +123,7 @@ fhandler_netdrive::exists ()
nr.lpLocalName = NULL;
nr.lpRemoteName = namebuf;
DWORD ret = create_thread_and_wait (GET_RESOURCE_INFO, &nr, NULL, 0,
- "WnetGetResourceInformation");
+ "WNetGetResourceInformation");
if (ret != ERROR_MORE_DATA && ret != NO_ERROR)
return 0;
return 1;
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index 9d7cc96a5..2cc4c0ce0 100644
--- a/winsup/cygwin/winsup.h
+++ b/winsup/cygwin/winsup.h
@@ -187,6 +187,8 @@ extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *);
enum exit_states
{
ES_NOT_EXITING = 0,
+ ES_SET_MUTO,
+ ES_GLOBAL_DTORS,
ES_EVENTS_TERMINATE,
ES_THREADTERM,
ES_SIGNAL,