diff options
author | Christopher Faylor <me@cgf.cx> | 2001-10-13 21:23:35 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-10-13 21:23:35 +0400 |
commit | 0476bae576d4a21ed57cc55074509c07138d1fba (patch) | |
tree | dc30019ce3ba2d8eb84d34f3b650827bbf4fc999 /winsup/cygwin/pinfo.cc | |
parent | 5dec13e1793901735554fd4dd60cad64c9394bb5 (diff) |
* fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successful
SNDCTL_DSP_GETBLKSIZE operation. Remove obsolete 'name' arg from fhandler_*
constructors throughout.
* winsup.h (winsock_active): New macro.
(winsock2_active): Ditto.
* autoload.cc (wsock_init): Use new macros to decide if winsock or winsock2 is
loaded.
(nonexist_wsock32): Dummy function to force winsock load.
(nonexist_ws2_32): Dummy function to force winsock2 load.
* fhandler.h (fhandler_socket::fstat): Declare new method. Currently unused.
* fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check that
winsock2 is active before trying WSADuplicateSocketA.
(fhandler_socket::fixup_after_fork): Add extra check for winsock2_active.
Otherwise use iffy procedures for Windows 95.
(fhandler_socket::fixup_after_exec): Add debugging.
(fhandler_socket::dup): Add debugging.
(fhandler_socket::fstat): New method.
(fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on Windows
95.
* errno.cc (_sys_nerr): Work around compiler strangeness.
* pinfo.cc (winpids::add): Add extra element at end of allocated array for
setting to NULL.
(winpids::enumNT): Ditto.
(winpids::init): Don't modify pidlist if it hasn't been allocated
(possibly due to malloc problem).
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 6e66e47a1..48b257699 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -293,8 +293,8 @@ winpids::add (DWORD& nelem, bool winpid, DWORD pid) if (nelem >= npidlist) { npidlist += slop_pidlist; - pidlist = (DWORD *) realloc (pidlist, size_pidlist (npidlist)); - pinfolist = (pinfo *) realloc (pinfolist, size_pinfolist (npidlist)); + pidlist = (DWORD *) realloc (pidlist, size_pidlist (npidlist + 1)); + pinfolist = (pinfo *) realloc (pinfolist, size_pinfolist (npidlist + 1)); } pinfolist[nelem].init (cygpid, PID_NOREDIR); @@ -324,7 +324,7 @@ winpids::enumNT (bool winpid) DWORD nelem = 0; if (!szprocs) - procs = (SYSTEM_PROCESSES *) malloc (szprocs = 200 * sizeof (*procs)); + procs = (SYSTEM_PROCESSES *) malloc (sizeof (*procs) + (szprocs = 200 * sizeof (*procs))); NTSTATUS res; for (;;) @@ -387,7 +387,8 @@ void winpids::init (bool winpid) { npids = (this->*enum_processes) (winpid); - pidlist[npids] = 0; + if (pidlist) + pidlist[npids] = 0; } DWORD |