I noticed a posting on c.l.p.m. where someone noticed that kill 0 caused an ever-increasing use of handles on Win32. It appears that in the case of signal 0 or 2, a value is returned without closing the process handle first. This is only noticable if you repeatedly run kill 0 (or 2) in a loop.

# The following code snippet is from win32/win32.c.  Sorry, I dunno how
# to 'diff' in Windows.  Looks like there are 2 spots where this needs to
# be fixed.

hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE,
                                   (IsWin95() ? -pid : pid));

if (hProcess) {
  switch(sig) {
        case 0:
           /* "Does process exist?" use of kill */
           CloseHandle(hProcess); /* ADD THIS LINE FOR 0 and 2 */
           return 0;

Regards,

Dan

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail




Reply via email to