]> git.pld-linux.org Git - packages/cvs.git/blob - cvs-fixed_buffer.patch
rel 20; rediff patches
[packages/cvs.git] / cvs-fixed_buffer.patch
1 --- cvs/src/buffer.h.org        2007-11-05 20:50:00.611456571 +0100
2 +++ cvs/src/buffer.h    2007-11-05 20:50:11.485304127 +0100
3 @@ -16,6 +16,8 @@
4  
5  #if defined (SERVER_SUPPORT) || defined (CLIENT_SUPPORT)
6  
7 +# include <unistd.h>
8 +
9  # include "getpagesize.h"
10  
11  /*
12 diff -ur cvs-1.11.1p1.orig/src/buffer.c cvs-1.11.1p1/src/buffer.c
13 --- cvs-1.11.1p1.orig/src/buffer.c      Thu Apr 19 21:29:05 2001
14 +++ cvs-1.11.1p1/src/buffer.c   Thu Feb 14 13:22:23 2002
15 @@ -292,15 +293,28 @@
16  
17             if (nbytes != data->size)
18             {
19 +               struct buffer_data *p;
20 +               int cnt;
21 +               
22                 /* Not all the data was written out.  This is only
23                     permitted in nonblocking mode.  Adjust the buffer,
24                     and return.  */
25  
26                 assert (buf->nonblocking);
27  
28 +               cnt = 0;
29 +               for (p = data; p->next; p = p->next)
30 +                       cnt++;
31 +
32                 data->size -= nbytes;
33                 data->bufp += nbytes;
34  
35 +               /* Don't allow buffers to grow over 100 pages. */
36 +               if (cnt > 100) {
37 +                       usleep(100000);
38 +                       continue;
39 +               }
40 +                       
41                 return 0;
42             }
43         }
This page took 0.15456 seconds and 3 git commands to generate.