[Win32utils-devel] win32-job, JRuby, kill and process_list

Daniel Berger djberg96 at gmail.com
Fri Feb 7 22:59:53 UTC 2014


On Thu, Feb 6, 2014 at 6:47 PM, Heesob Park <phasis at gmail.com> wrote:

> Hi,
>
> 2014-02-07 Daniel Berger <djberg96 at gmail.com>:
> > Hi all,
> >
> > I'm getting one test failure with win32-job using JRuby 1.7.10 on
> Windows 7.
> > It seems the kill method terminates the processes alright, but when I
> check
> > the process list again, it's returning one pid
> >
> >   # job_test.rb
> >   require 'win32/job'
> >   include Win32
> >
> >   pid1 = Process.spawn('notepad')
> >   pid2 = Process.spawn('notepad')
> >
> >   j = Job.new('test')
> >   p j.process_list
> >
> >   j.add_process(pid1)
> >   j.add_process(pid2)
> >   p j.process_list # [pid1, pid2]
> >
> >   j.kill
> >   p j.process_list # Should be empty, but JRuby returns one pid.
> >
> >   j.close
> >
> > Any ideas?
> >
> You assumed wrong on ProcessIdList  array values.
>
> Read carefully the document(
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms684150(v=vs.85).aspx
> )
> ProcessIdList
> A variable-length array of process identifiers returned by this call.
> Array elements 0 through NumberOfProcessIdsInList-1 contain valid
> process identifiers.
>
> I committed the patch.
>

Thanks! I've released 0.1.2 which includes your patch.

Regards,

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20140207/eac11077/attachment.html>


More information about the win32utils-devel mailing list