[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Annoying problem with subprocesses
sdupont@xxxxxxx <sdupont@xxxxxxx> wrote:
>So I checked get_process_status() again and there seems to be a bug
>in the adjustment since Subprocess_Read_fds[i][0] (the actual fd)
>is checked and not Subprocess_Read_fds[i][1] (the jed rep.) as it should(?):
I believe you are correct, except I do not think that your patch is
entirely correct:
>static void get_process_status (Process_Type *p) /*{{{*/
>{
> [...]
> /* Adjust the array of read descriptors */
>
> i = 0;
>
> while (i < Num_Subprocesses)
> {
> /* if (Subprocess_Read_fds[i][0] == slfd) WRONG? */
> if (Subprocess_Read_fds[i][1] == slfd)
> break;
>
The above appears to be the correct patch, but I do not believe the
changes below are necessary:
> i++;
> }
> /*fd = Subprocess_Read_fds [i][0]; WRONG? */
> fd = Subprocess_Read_fds [i][1];
>
> [...]
>
> if (Max_Subprocess_FD == fd)
> {
> i = 0;
> fd = -1;
> while (i < Num_Subprocesses)
> {
> /*if (Subprocess_Read_fds[i][0] > fd)
> fd = Subprocess_Read_fds[i][0]; WRONG? */
> if (Subprocess_Read_fds[i][1] > fd)
> fd = Subprocess_Read_fds[i][1];
> i++;
> }
> Max_Subprocess_FD = fd;
> }
>Doing this little change, subprocesses work as expected (=GREAT!)
If you leave out the changes in the above bit of quoted text, do the
subprocesses still work?
Thanks,
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.