]> code.delx.au - gnu-emacs/blobdiff - src/filelock.c
Merge from origin/emacs-24
[gnu-emacs] / src / filelock.c
index 24d44073340cd55e367a4fbcf5bf811d28ab1bad..89d3e3502194c9951239822282c247f8b27a454c 100644 (file)
@@ -55,8 +55,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "w32.h"       /* for dostounix_filename */
 #endif
 
-#ifdef CLASH_DETECTION
-
 #ifdef HAVE_UTMP_H
 #include <utmp.h>
 #endif
@@ -211,8 +209,6 @@ get_boot_time (void)
                                            WTMP_FILE, counter);
          if (! NILP (Ffile_exists_p (tempname)))
            {
-             Lisp_Object args[6];
-
              /* The utmp functions on mescaline.gnu.org accept only
                 file names up to 8 characters long.  Choose a 2
                 character long prefix, and call make_temp_file with
@@ -221,13 +217,9 @@ get_boot_time (void)
              filename = Fexpand_file_name (build_string ("wt"),
                                            Vtemporary_file_directory);
              filename = make_temp_name (filename, 1);
-             args[0] = build_string ("gzip");
-             args[1] = Qnil;
-             args[2] = list2 (QCfile, filename);
-             args[3] = Qnil;
-             args[4] = build_string ("-cd");
-             args[5] = tempname;
-             Fcall_process (6, args);
+             CALLN (Fcall_process, build_string ("gzip"), Qnil,
+                    list2 (QCfile, filename), Qnil,
+                    build_string ("-cd"), tempname);
              delete_flag = 1;
            }
        }
@@ -594,9 +586,10 @@ current_lock_owner (lock_info_type *owner, char *lfname)
     return -1;
 
   /* On current host?  */
-  if (STRINGP (Vsystem_name)
-      && dot - (at + 1) == SBYTES (Vsystem_name)
-      && memcmp (at + 1, SSDATA (Vsystem_name), SBYTES (Vsystem_name)) == 0)
+  Lisp_Object system_name = Fsystem_name ();
+  if (STRINGP (system_name)
+      && dot - (at + 1) == SBYTES (system_name)
+      && memcmp (at + 1, SSDATA (system_name), SBYTES (system_name)) == 0)
     {
       if (pid == getpid ())
         ret = 2; /* We own it.  */
@@ -773,7 +766,9 @@ DEFUN ("lock-buffer", Flock_buffer, Slock_buffer,
        0, 1, 0,
        doc: /* Lock FILE, if current buffer is modified.
 FILE defaults to current buffer's visited file,
-or else nothing is done if current buffer isn't visiting a file.  */)
+or else nothing is done if current buffer isn't visiting a file.
+
+If the option `create-lockfiles' is nil, this does nothing.  */)
   (Lisp_Object file)
 {
   if (NILP (file))
@@ -837,8 +832,6 @@ t if it is locked by you, else a string saying which user has locked it.  */)
   return ret;
 }
 
-#endif /* CLASH_DETECTION */
-
 void
 syms_of_filelock (void)
 {
@@ -850,9 +843,7 @@ syms_of_filelock (void)
               doc: /* Non-nil means use lockfiles to avoid editing collisions.  */);
   create_lockfiles = 1;
 
-#ifdef CLASH_DETECTION
   defsubr (&Sunlock_buffer);
   defsubr (&Slock_buffer);
   defsubr (&Sfile_locked_p);
-#endif
 }