>>>> "Jonathan" == Jonathan Harris
<jhar(a)tardis.ed.ac.uk> writes:
Hello Jonathan, Craig, Bill!
Jonathan> call_process_cleanup(). You should probably change
Jonathan> wait_for_termination() so that on win32 its argument is
Jonathan> "phandle" rather than "pid".
Done.
if (os_subtype == OS_WIN95) {
I negate the pid again.
Craig, could you please test one of the attached patches again?
For your convenience I have produced and tested two of them, one
against 21.1.7 and one against latest CVS status past 21.2-b19.
I hope this will work on Windows95/98 finally.
Jonathan> How about using WaitForSingleObject(pid, 1/10s) instead
Jonathan> of GetExitCodeProcess() in your do...while loop in
Jonathan> wait_for_termination(). That might make XEmacs to use a
I'm doing the following, which should be equivalent:
QUIT;
/*
* Wait for the child process to be signalled. We wait
* indefinitely, since spinning a loop while (ret == WAIT_TIMEOUT)
* would amount to the same.
*/
ret = WaitForSingleObject(pid, INFINITE);
Should it be possible to keyboard-quit (C-g) a long-running process?
I cannot interrupt
(apply 'call-process "sleep" nil nil nil (list "30"))
short of using Task Manager to "End Process".
Jonathan> lot less CPU and let its child process exit more
Jonathan> quickly. You'll obviously still need to call
Jonathan> GetExitCodeProcess() once after the child has really
Jonathan> terminated.
Done that.
Jonathan> On Windows 95/98 process IDs are negative(!) which
Jonathan> screws up in a call to make_int() in
Jonathan> Fcall_process_internal() by blowing the 30(?) bit lisp
Jonathan> integer size. There's a nasty hack in create_child at
Jonathan> line 450 of ntproc.c to get round this by making the PID
Jonathan> positive. The problem that Craig was experiencing with
Jonathan> your original patch may have been due to the fact that
Jonathan> you weren't renegativising the PID in the call to
Jonathan> OpenProcess(). Your code still has this problem. You
Attached patch is trying to fix this. Let's see what Craig (or
others) will report. I am testing this on WindowsNT Workstation 4sp4
with VC++6.0.
Jonathan> either have to include ntheap.h and make the pid passed
Jonathan> to OpenProcess negative if (os_subtype==OS_WIN95), or
Jonathan> you have to come up with a better general solution to
Jonathan> the negative pid problem.
I tried a drastic change to pass around process handles instead of
PIDs but failed miserably. The PID concept is pretty well wired into
XEmacs from the UNIX world.
Jonathan> Jonathan.
Thanks for all the help!
I have attached
Please test any of the following patches and give me feedback.
TIA,
Adrian
Jonathan> --
Jonathan> Jonathan Harris | jhar(a)tardis.ed.ac.uk
Jonathan> London, England | Jonathan.Harris(a)symbian.com