From owner-cvs-gnu Fri Mar 31 10:02:04 1995 Return-Path: cvs-gnu-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA29367 for cvs-gnu-outgoing; Fri, 31 Mar 1995 10:02:04 -0800 Received: (from nate@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA29357; Fri, 31 Mar 1995 10:02:03 -0800 Date: Fri, 31 Mar 1995 10:02:03 -0800 From: Nate Williams Message-Id: <199503311802.KAA29357@freefall.cdrom.com> To: CVS-commiters, cvs-gnu Subject: cvs commit: src/gnu/usr.bin/cvs/cvs lock.c Sender: cvs-gnu-owner@freebsd.org Precedence: bulk nate 95/03/31 10:02:03 Modified: gnu/usr.bin/cvs/cvs lock.c Log: The enclosed patch contains two separate improvements to CVS' lock file handling code. The first is a change to set_lock(). It no longer takes an lockdir argument, instead it computes the lock directory itself and stores it in a new file-global array masterlock. A new function clear_lock() is used to remove the master lock directory. Using the masterlock array avoids having to sprintf() together the lock directory path multiple times in each lock function, and avoids adding another PATH_MAX sized array (which would be an alternate solution to this problem). The above change is a win on machines with relatively slow sprintf functions. Sprintf is not as fast as it once was, as ANSI C requires the format argument to be interpreted as a multi-byte string. The other change in this patch is to #ifdef out the code that creates CVSTLK files. I, and others that I have shown the code to, can't think of any reason why it is needed. Any errors that the code would report would have been cought by the set_lock() call that immediately follows. I #ifdef'd this out because there are neither comments nor a ChangeLog entry that explain why someone thought it's necessary; and because it slows down locking considerably, especially on NFS-mounted repositories. I've run a version of CVS without it for a few months without ill effect. Submitted by: "J.T. Conklin"