> This is the hanging code:
> 
> void do_forward(void)
> {
>   char buf[4096], *b;
>   int r, rr;
>   setsid();
>   while ((r = read(0, buf, sizeof(buf))) > 0)
>     {
>       b = buf;
>       while (r > 0)
>         {
>           rr = write(1, b, r);
>           if (rr == -1)
>             {
>               perror("write");
>               rr = r;
>             }
>           r -= rr;
>         }
>     }
>   _exit(0);
> }

Sorry to barge in, I really know nothing about this code or
the bug.  But it seems to me that this code should augment b.
Otherwise this code can behave as an infinite loop.
I.e. it should be:

              }
            r -= rr;
+           b += rr;
          }

Perhaps that is the cause of the problem?

-ic
--
Iain Calder  <[email protected]>  Toronto, Canada



_______________________________________________
Pkg-sysvinit-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-sysvinit-devel

Reply via email to