[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch
From: |
Mark D . Baushke |
Subject: |
[Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch |
Date: |
Thu, 29 Sep 2005 17:35:12 -0400 |
Index: ccvs/contrib/rcs-5.7-commitid.patch
diff -u ccvs/contrib/rcs-5.7-commitid.patch:1.5
ccvs/contrib/rcs-5.7-commitid.patch:1.6
--- ccvs/contrib/rcs-5.7-commitid.patch:1.5 Thu Sep 29 20:33:19 2005
+++ ccvs/contrib/rcs-5.7-commitid.patch Thu Sep 29 21:35:09 2005
@@ -239,7 +239,7 @@
void unexpected_EOF P((void)) exiting;
Index:src/ci.c
--- src/ci.c~ 1995-06-15 23:19:24.000000000 -0700
-+++ src/ci.c 2005-09-29 01:14:00.856504000 -0700
++++ src/ci.c 2005-09-29 14:18:16.783506000 -0700
@@ -262,6 +262,10 @@ static void cleanup P((void));
static void incnum P((char const*,struct buf*));
static void addassoclst P((int,char const*));
@@ -259,7 +259,7 @@
char *a, **newargv, *textfile;
char const *author, *krev, *rev, *state;
char const *diffname, *expname;
-@@ -309,6 +314,38 @@ mainProg(ciId, "ci", "$Id: ci.c,v 5.30 1
+@@ -309,6 +314,51 @@ mainProg(ciId, "ci", "$Id: ci.c,v 5.30 1
suffixes = X_DEFAULT;
nextassoc = &assoclst;
@@ -267,17 +267,30 @@
+ char buf[COMMITID_RAW_SIZE] = { 0, };
+ ssize_t len = 0;
+ time_t rightnow = time (NULL);
-+ unsigned char *p = (unsigned char *) (buf + sizeof(time_t));
-+ int fd = open (urandom_dev, O_RDONLY, O_NOCTTY);
++ char *startrand = buf + sizeof (time_t);
++ unsigned char *p = (unsigned char *) startrand;
++ size_t randbytes = RANDOM_BYTES;
++ int flags = O_RDONLY;
++ int fd;
++#ifdef O_NOCTTY
++ flags |= O_NOCTTY;
++#endif
++ if (rightnow != (time_t)-1) {
++ /* try to use more random data */
++ randbytes = COMMITID_RAW_SIZE;
++ startrand = buf;
++ }
++ fd = open (urandom_dev, flags);
+ if (fd >= 0) {
+ len = read (fd, buf + sizeof(time_t), RANDOM_BYTES);
+ close (fd);
+ }
-+ if (len > 0 && rightnow != (time_t)-1) {
-+ while (rightnow > 0) {
-+ *--p = rightnow % (UCHAR_MAX + 1);
-+ rightnow /= UCHAR_MAX + 1;
-+ }
++ if (len > 0) {
++ if (rightnow != (time_t)-1)
++ while (rightnow > 0) {
++ *--p = rightnow % (UCHAR_MAX + 1);
++ rightnow /= UCHAR_MAX + 1;
++ }
+ } else {
+ long int pid = (long int)getpid ();
+ p = (unsigned char *) (buf + sizeof (buf));
@@ -298,7 +311,7 @@
argc = getRCSINIT(argc, argv, &newargv);
argv = newargv;
while (a = *++argv, 0<--argc && *a++=='-') {
-@@ -532,6 +569,8 @@ mainProg(ciId, "ci", "$Id: ci.c,v 5.30 1
+@@ -532,6 +582,8 @@ mainProg(ciId, "ci", "$Id: ci.c,v 5.30 1
newdelta.name = 0;
clear_buf(&newdelta.ig);
clear_buf(&newdelta.igtext);
@@ -307,7 +320,7 @@
/* set author */
if (author)
newdelta.author=author; /* set author given by -w */
-@@ -1317,3 +1356,38 @@ addassoclst(flag, sp)
+@@ -1317,3 +1369,38 @@ addassoclst(flag, sp)
*nextassoc = pt;
nextassoc = &pt->nextsym;
}
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Mark D . Baushke, 2005/09/26
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Mark D . Baushke, 2005/09/27
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Mark D . Baushke, 2005/09/28
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Mark D . Baushke, 2005/09/29
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Derek Robert Price, 2005/09/29
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch,
Mark D . Baushke <=
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Mark D . Baushke, 2005/09/29
- [Cvs-cvs] Changes to ccvs/contrib/rcs-5.7-commitid.patch, Mark D . Baushke, 2005/09/30