jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Annoying problem with subprocesses


On Tue, 28 Jan 2003 11:21:37 -0500
"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:

> 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?

Yes, you're right. I wrongly assumed that 'fd' is used for the jed representation
of the descriptor but it's for the master_read descriptor.
So, the only necessary change is:

if (Subprocess_Read_fds[i][1] == slfd)
                           ^ 
Greetings
Stefan


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]