* 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.
This commit is contained in:
Christopher Faylor 2005-06-07 18:41:31 +00:00
parent 7066fc51d7
commit b739751db9
7 changed files with 33 additions and 9 deletions

View File

@ -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> 2005-06-06 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): If GetFileAttributes returns * path.cc (symlink_info::check): If GetFileAttributes returns

View File

@ -344,7 +344,7 @@ cygthread::detach (HANDLE sigwait)
break; break;
default: default:
if (!exiting) if (!exiting)
api_fatal ("WFMO failed waiting for cygthread '%s'", __name); api_fatal ("WFMO failed waiting for cygthread '%s', %E", __name);
break; break;
} }
/* WAIT_OBJECT_0 means that the thread successfully read something, /* WAIT_OBJECT_0 means that the thread successfully read something,

View File

@ -1013,8 +1013,18 @@ do_exit (int status)
#endif #endif
EnterCriticalSection (&exit_lock); EnterCriticalSection (&exit_lock);
if (exit_state < ES_SET_MUTO)
{
exit_state = ES_SET_MUTO;
muto::set_exiting_thread (); muto::set_exiting_thread ();
}
if (exit_state < ES_GLOBAL_DTORS)
{
exit_state = ES_GLOBAL_DTORS;
dll_global_dtors (); dll_global_dtors ();
}
if (exit_state < ES_EVENTS_TERMINATE) if (exit_state < ES_EVENTS_TERMINATE)
{ {

View File

@ -269,7 +269,7 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
break; break;
} }
default: 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); __seterrno_from_win_error (errcode);
bytes_read = (size_t) -1; bytes_read = (size_t) -1;
break; break;

View File

@ -184,7 +184,8 @@ fhandler_fifo::dup (fhandler_base *child)
if (!res) if (!res)
{ {
fhandler_fifo *ff = (fhandler_fifo *) child; fhandler_fifo *ff = (fhandler_fifo *) child;
if (!DuplicateHandle (hMainProc, get_output_handle (), hMainProc, if (get_output_handle ()
&& !DuplicateHandle (hMainProc, get_output_handle (), hMainProc,
&ff->get_output_handle (), false, true, &ff->get_output_handle (), false, true,
DUPLICATE_SAME_ACCESS)) DUPLICATE_SAME_ACCESS))
{ {
@ -193,5 +194,5 @@ fhandler_fifo::dup (fhandler_base *child)
res = -1; res = -1;
} }
} }
return 0; return res;
} }

View File

@ -123,7 +123,7 @@ fhandler_netdrive::exists ()
nr.lpLocalName = NULL; nr.lpLocalName = NULL;
nr.lpRemoteName = namebuf; nr.lpRemoteName = namebuf;
DWORD ret = create_thread_and_wait (GET_RESOURCE_INFO, &nr, NULL, 0, DWORD ret = create_thread_and_wait (GET_RESOURCE_INFO, &nr, NULL, 0,
"WnetGetResourceInformation"); "WNetGetResourceInformation");
if (ret != ERROR_MORE_DATA && ret != NO_ERROR) if (ret != ERROR_MORE_DATA && ret != NO_ERROR)
return 0; return 0;
return 1; return 1;

View File

@ -187,6 +187,8 @@ extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *);
enum exit_states enum exit_states
{ {
ES_NOT_EXITING = 0, ES_NOT_EXITING = 0,
ES_SET_MUTO,
ES_GLOBAL_DTORS,
ES_EVENTS_TERMINATE, ES_EVENTS_TERMINATE,
ES_THREADTERM, ES_THREADTERM,
ES_SIGNAL, ES_SIGNAL,