]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygthread.cc (cygthread::detach): Make error message a little more detailed.
authorChristopher Faylor <me@cgf.cx>
Tue, 7 Jun 2005 18:41:31 +0000 (18:41 +0000)
committerChristopher Faylor <me@cgf.cx>
Tue, 7 Jun 2005 18:41:31 +0000 (18:41 +0000)
* 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.

winsup/cygwin/ChangeLog
winsup/cygwin/cygthread.cc
winsup/cygwin/dcrt0.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler_fifo.cc
winsup/cygwin/fhandler_netdrive.cc
winsup/cygwin/winsup.h

index 902b96f37a7034bcb8c760ee35e49e1d7519042c..16a2307d56c72888c338e6ed1675efa8c1976477 100644 (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>
 
        * path.cc (symlink_info::check): If GetFileAttributes returns
index d032b0f07f4428839404f0a3f5cf341bba840810..af60abf2abd64a1fad6cd66841e7a5b45bd03d08 100644 (file)
@@ -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,
index 457661000e8f90de2d990b7f405043d37b94f7de..ea0edbd0c535533869e9c0ac5884991640d7af8b 100644 (file)
@@ -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)
     {
index 6c0eaec3808331bd24c1d9b3232877d0078bd418..c5074a3fe8d3197a5ce544bde15b816d93ca2fee 100644 (file)
@@ -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;
index 4ff94bb4e52264b53eaea2e6488387874ee4d7a4..742b70c100a29353181955a94834bdbc90557c00 100644 (file)
@@ -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;
 }
index bad6b491cfb6e48bc96f30e3488c3534619aa105..8249673bebb7a7d0dde126c775488cd38a17dee0 100644 (file)
@@ -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;
index 9d7cc96a58ac2e4de010f3a60a513c8181de3bcf..2cc4c0ce0ed1478396f845ed3667d9f746ccc8c0 100644 (file)
@@ -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,
This page took 0.040903 seconds and 5 git commands to generate.