RCS + modification time?

David Brown david at varian.UUCP
Fri Nov 9 09:53:42 AEST 1984


A few weeks I asked if anyone saw any problems in having the co and rcs
commands of RCS use utime(2) to reset the modification time of the RCS
file when it is locked or unlocked; this is to prevent make from
recompiling that module when the only change is that someone is checked
it out with a lock.

I went away and made the changes; they were very simple - I have included
them below.  tektronix!glaser (Steve Glaser) posted a followup saying
that something similar was implemented at Tektronix with a -P flag.
He also suggested doing the utime() call before the RCS file is renamed
from ,RCSxxxx to close the small window I noticed where a make could
come through between the rename and the change of the modification time;
I failed to do this in the changes described below, but I plan to change
this next time I'm working on RCS modifications.

Steve also pointed out the following:
One further major gotcha with RCS.  The number of revisions is strictly
limited and the standard number is about 239 revisions.  We made it 719
and added a warning if you're within 20 of that.  If you overflow the
table, the ,v file becomes useless to RCS.

Thanks to Steve and everyone else who replied.

In addition, I made a small change to rcsutil.c. On our pdp11 (running
sort of 2.8bsd), but not on our VAX (running 4.1bsd), we found a problem where
programs running in the background will be stopped by a <ctrl> C typed
in the foreground.  This is because catchints() is setting SIGINT to
catchsig(); I changed catchints() and ignoreints() so that they didn't
touch SIGINT at all and things seem to be working fine now.  I don't know
if there is something strange about our pdp11 kernel or whether the problem
is present in all 2.8bsd and v7 systems.


Here are my changes to co.c and rcs.c:

*** OLD/co.c	Thu Apr  7 09:36:23 1983
--- co.c	Tue Oct 30 12:44:47 1984
***************
*** 276,281
                          newRCSfilename[0]='\0'; /* avoid re-deletion by cleanup()*/
                          if (chmod(RCSfilename,RCSstat.st_mode & ~0222)<0)
                              warn("Can't preserve mode of %s",RCSfilename);
  			catchints();
                  }
  

--- 279,287 -----
                          newRCSfilename[0]='\0'; /* avoid re-deletion by cleanup()*/
                          if (chmod(RCSfilename,RCSstat.st_mode & ~0222)<0)
                              warn("Can't preserve mode of %s",RCSfilename);
+ #ifdef VARIAN
+ 			utime(RCSfilename,&RCSstat.st_atime);
+ #endif VARIAN
  			catchints();
                  }
  
*** OLD/rcs.c	Tue Oct  9 15:25:39 1984
--- rcs.c	Tue Oct 30 12:44:30 1984
***************
*** 514,519
              }
              newRCSfilename[0]='\0'; /* avoid re-unlinking by cleanup()*/
              if (!initflag) /* preserve mode bits */
                  if (chmod(RCSfilename,filestatus.st_mode & ~0222)<0)
                          warn("Can't set mode of %s",RCSfilename);
  

--- 518,525 -----
              }
              newRCSfilename[0]='\0'; /* avoid re-unlinking by cleanup()*/
              if (!initflag) /* preserve mode bits */
+ #ifdef VARIAN
+ 	    {
+                 if (chmod(RCSfilename,filestatus.st_mode & ~0222)<0)
+                         warn("Can't set mode of %s",RCSfilename);
+ 		utime(RCSfilename,&filestatus.st_atime);
+ 	    }
+ #else
+                 if (chmod(RCSfilename,filestatus.st_mode & ~0222)<0)
+                         warn("Can't set mode of %s",RCSfilename);
+ #endif VARIAN


-- 
	David Brown	 (415) 945-2199
	Varian Instruments 2700 Mitchell Dr.  Walnut Creek, Ca. 94598
	{zehntel,amd,fortune,resonex}!varian!david



More information about the Comp.unix mailing list