OSDN Git Service

* pinfo.cc (enum_init): Don't suffer silently if we can't load the process
authorcgf <cgf>
Tue, 31 Oct 2000 17:01:56 +0000 (17:01 +0000)
committercgf <cgf>
Tue, 31 Oct 2000 17:01:56 +0000 (17:01 +0000)
enumerators.

winsup/cygwin/ChangeLog
winsup/cygwin/pinfo.cc

index 0d8c0cd..cb2bc04 100644 (file)
@@ -1,3 +1,8 @@
+Tue Oct 31 12:00:06 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * pinfo.cc (enum_init): Don't suffer silently if we can't load the
+       process enumerators.
+
 Mon Oct 30 16:54:26 2000  Christopher Faylor <cgf@cygnus.com>
 
        * signal.cc (kill_pgrp): Revert 25-Oct change.
index f509828..3b5f002 100644 (file)
@@ -337,10 +337,16 @@ enum_init (DWORD *lpidProcess, DWORD cb, DWORD *cbneeded)
     {
       h = LoadLibrary ("psapi.dll");
       if (!h)
-       return 0;
+       {
+         system_printf ("couldn't load psapi.dll, %E");
+         return 0;
+       }
       myEnumProcesses = (ENUMPROCESSES) GetProcAddress (h, "EnumProcesses");
       if (!myEnumProcesses)
-       return 0;
+       {
+         system_printf ("couldn't locate EnumProcesses in psapi.dll, %E");
+         return 0;
+       }
     }
   else
     {
@@ -352,7 +358,10 @@ enum_init (DWORD *lpidProcess, DWORD cb, DWORD *cbneeded)
       myProcess32Next  = (PROCESSWALK)
              GetProcAddress(h, "Process32Next");
       if (!myCreateToolhelp32Snapshot || !myProcess32First || !myProcess32Next)
-       return 0;
+       {
+         system_printf ("Couldn't find toolhelp processes, %E");
+         return 0;
+       }
 
       myEnumProcesses = EnumProcessesW95;
     }