URI: 
       trc: fix segfault when SIGINT is received - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 74be46038de399f5d5ba48bef15a3b649b883967
   DIR parent 1d534ed6ceb13aa90fea2d0889bdb28ff946ac8d
  HTML Author: Michael Teichgräber <mt4swm@googlemail.com>
       Date:   Sat,  8 Aug 2009 16:27:01 -0400
       
       rc: fix segfault when SIGINT is received
       
       Save the value of `runq' at the start of the function, so that the `pc'
       update
       at the end does work on that original value, and not on a probably
       modified
       value of `runq'.
       
       fixes #14 http://code.swtch.com/plan9port/issue/14/
       
       http://codereview.appspot.com/104066
       
       Diffstat:
         M src/cmd/rc/havefork.c               |       3 ++-
       
       1 file changed, 2 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/src/cmd/rc/havefork.c b/src/cmd/rc/havefork.c
       t@@ -110,6 +110,7 @@ Xpipe(void)
        void
        Xbackq(void)
        {
       +        struct thread *p = runq;
                char wd[8193];
                int c;
                char *s, *ewd=&wd[8192], *stop;
       t@@ -164,7 +165,7 @@ Xbackq(void)
                                runq->argv->words = v;
                                v = nextv;
                        }
       -                runq->pc = runq->code[runq->pc].i;
       +                p->pc = p->code[p->pc].i;
                        return;
                }
        }