* 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-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
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,
#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)
{
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;
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;
}
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;
enum exit_states
{
ES_NOT_EXITING = 0,
+ ES_SET_MUTO,
+ ES_GLOBAL_DTORS,
ES_EVENTS_TERMINATE,
ES_THREADTERM,
ES_SIGNAL,