- * lock.c -- routines to lock/unlock files
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-/* Modified by Ruud de Rooij to support Miquel van Smoorenburg's liblockfile
- *
- * Since liblockfile locking shares most of its code with dot locking, it
- * is enabled by defining both DOT_LOCKING and HAVE_LIBLOCKFILE.
- *
- * Ruud de Rooij <ruud@debian.org> Sun, 28 Mar 1999 15:34:03 +0200
- */
+** lock.c -- routines to lock/unlock files
+**
+** This code is Copyright (c) 2002, by the authors of nmh. See the
+** COPYRIGHT file in the root directory of the nmh distribution for
+** complete copyright information.
+*/
+
+/*
+** Modified by Ruud de Rooij to support Miquel van Smoorenburg's liblockfile
+**
+** Since liblockfile locking shares most of its code with dot locking, it
+** is enabled by defining both DOT_LOCKING and HAVE_LIBLOCKFILE.
+**
+** Ruud de Rooij <ruud@debian.org> Sun, 28 Mar 1999 15:34:03 +0200
+*/
- * Base routine to open and lock a file,
- * and return a file descriptor.
- */
+** Base routine to open and lock a file,
+** and return a file descriptor.
+*/
- * Base routine to close and unlock a file,
- * given a file descriptor.
- */
+** Base routine to close and unlock a file,
+** given a file descriptor.
+*/
- * Base routine to open and lock a file,
- * and return a FILE pointer
- */
+** Base routine to open and lock a file,
+** and return a FILE pointer
+*/
- * Get the name of the eventual lock file, as well
- * as a name for a temporary lock file.
- */
+ ** Get the name of the eventual lock file, as well
+ ** as a name for a temporary lock file.
+ */
lockname (file, &lkinfo, 1);
#if !defined(HAVE_LIBLOCKFILE)
lockname (file, &lkinfo, 1);
#if !defined(HAVE_LIBLOCKFILE)
- * Abort locking, if we fail to lock after 5 attempts
- * and are never able to stat the lock file.
- */
+ ** Abort locking, if we fail to lock after 5
+ ** attempts and are never able to stat the
+ ** lock file.
+ */
- * mmdf style dot locking. Currently not supported.
- * If we start supporting mmdf style dot locking,
- * we will need to change the return value of lockname
- */
+ ** mmdf style dot locking. Currently not supported.
+ ** If we start supporting mmdf style dot locking,
+ ** we will need to change the return value of lockname
+ */
- * If this is for a new lock, create a name for
- * the temporary lock file for lockit()
- */
+ ** If this is for a new lock, create a name for
+ ** the temporary lock file for lockit()
+ */
if (isnewlock) {
if ((cp = strrchr (li->curlock, '/')) == NULL || *++cp == 0)
strncpy (li->tmplock, ",LCK.XXXXXX", sizeof(li->tmplock));
if (isnewlock) {
if ((cp = strrchr (li->curlock, '/')) == NULL || *++cp == 0)
strncpy (li->tmplock, ",LCK.XXXXXX", sizeof(li->tmplock));
- * Search through the list of lockfiles for the
- * current lockfile, and remove it from the list.
- */
+** Search through the list of lockfiles for the
+** current lockfile, and remove it from the list.
+*/
- * If timer goes off, we update the ctime of all open
- * lockfiles, so another command doesn't remove them.
- */
+** If timer goes off, we update the ctime of all open
+** lockfiles, so another command doesn't remove them.
+*/