/[cvs]/ccvs/contrib/rcs-5.7-commitid.patch
ViewVC logotype

Diff of /ccvs/contrib/rcs-5.7-commitid.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by mdb, Thu Sep 29 21:35:09 2005 UTC revision 1.7 by mdb, Thu Sep 29 22:09:16 2005 UTC
# Line 239  Index:src/rcsbase.h Line 239  Index:src/rcsbase.h
239   void unexpected_EOF P((void)) exiting;   void unexpected_EOF P((void)) exiting;
240  Index:src/ci.c  Index:src/ci.c
241  --- src/ci.c~   1995-06-15 23:19:24.000000000 -0700  --- src/ci.c~   1995-06-15 23:19:24.000000000 -0700
242  +++ src/ci.c    2005-09-29 14:18:16.783506000 -0700  +++ src/ci.c    2005-09-29 14:57:57.814504000 -0700
243  @@ -262,6 +262,10 @@ static void cleanup P((void));  @@ -262,6 +262,10 @@ static void cleanup P((void));
244   static void incnum P((char const*,struct buf*));   static void incnum P((char const*,struct buf*));
245   static void addassoclst P((int,char const*));   static void addassoclst P((int,char const*));
# Line 259  Index:src/ci.c Line 259  Index:src/ci.c
259          char *a, **newargv, *textfile;          char *a, **newargv, *textfile;
260          char const *author, *krev, *rev, *state;          char const *author, *krev, *rev, *state;
261          char const *diffname, *expname;          char const *diffname, *expname;
262  @@ -309,6 +314,51 @@ mainProg(ciId, "ci", " ci.c,v 5.30 1  @@ -309,6 +314,45 @@ mainProg(ciId, "ci", " ci.c,v 5.30 1
263          suffixes = X_DEFAULT;          suffixes = X_DEFAULT;
264          nextassoc = &assoclst;          nextassoc = &assoclst;
265    
# Line 275  Index:src/ci.c Line 275  Index:src/ci.c
275  +#ifdef O_NOCTTY  +#ifdef O_NOCTTY
276  +               flags |= O_NOCTTY;  +               flags |= O_NOCTTY;
277  +#endif  +#endif
278  +               if (rightnow != (time_t)-1) {  +               if (rightnow != (time_t)-1)
279    +                       while (rightnow > 0) {
280    +                               *--p = rightnow % (UCHAR_MAX + 1);
281    +                               rightnow /= UCHAR_MAX + 1;
282    +                       }
283    +               else {
284  +                       /* try to use more random data */  +                       /* try to use more random data */
285  +                       randbytes = COMMITID_RAW_SIZE;  +                       randbytes = COMMITID_RAW_SIZE;
286  +                       startrand = buf;  +                       startrand = buf;
287  +               }  +               }
288  +               fd = open (urandom_dev, flags);  +               fd = open (urandom_dev, flags);
289  +               if (fd >= 0) {  +               if (fd >= 0) {
290  +                       len = read (fd, buf + sizeof(time_t), RANDOM_BYTES);  +                       len = read (fd, startrand, randbytes);
291  +                       close (fd);  +                       close (fd);
292  +               }  +               }
293  +               if (len > 0) {  +               if (len <= 0) {
294  +                       if (rightnow != (time_t)-1)  +                       /* no random data was available so use pid */
 +                               while (rightnow > 0) {  
 +                                       *--p = rightnow % (UCHAR_MAX + 1);  
 +                                       rightnow /= UCHAR_MAX + 1;  
 +                               }  
 +               } else {  
295  +                       long int pid = (long int)getpid ();  +                       long int pid = (long int)getpid ();
296  +                       p = (unsigned char *) (buf + sizeof (buf));  +                       p = (unsigned char *) (startrand + sizeof (pid));
 +                       while (rightnow > 0) {  
 +                           *--p = rightnow % (UCHAR_MAX + 1);  
 +                           rightnow /= UCHAR_MAX + 1;  
 +                       }  
 +                       p = (unsigned char *) (buf + sizeof (buf)  
 +                                              - sizeof (time_t));  
297  +                       while (pid > 0) {  +                       while (pid > 0) {
298  +                           *--p = pid % (UCHAR_MAX + 1);  +                           *--p = pid % (UCHAR_MAX + 1);
299  +                           pid /= UCHAR_MAX + 1;  +                           pid /= UCHAR_MAX + 1;
# Line 311  Index:src/ci.c Line 305  Index:src/ci.c
305          argc = getRCSINIT(argc, argv, &newargv);          argc = getRCSINIT(argc, argv, &newargv);
306          argv = newargv;          argv = newargv;
307          while (a = *++argv,  0<--argc && *a++=='-') {          while (a = *++argv,  0<--argc && *a++=='-') {
308  @@ -532,6 +582,8 @@ mainProg(ciId, "ci", " ci.c,v 5.30 1  @@ -532,6 +576,8 @@ mainProg(ciId, "ci", " ci.c,v 5.30 1
309          newdelta.name = 0;          newdelta.name = 0;
310          clear_buf(&newdelta.ig);          clear_buf(&newdelta.ig);
311          clear_buf(&newdelta.igtext);          clear_buf(&newdelta.igtext);
# Line 320  Index:src/ci.c Line 314  Index:src/ci.c
314          /* set author */          /* set author */
315          if (author)          if (author)
316                  newdelta.author=author;     /* set author given by -w         */                  newdelta.author=author;     /* set author given by -w         */
317  @@ -1317,3 +1369,38 @@ addassoclst(flag, sp)  @@ -1317,3 +1363,38 @@ addassoclst(flag, sp)
318          *nextassoc = pt;          *nextassoc = pt;
319          nextassoc = &pt->nextsym;          nextassoc = &pt->nextsym;
320   }   }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26