diff src/filelock.c @ 40:7e54bd776075 r19-15b103

Import from CVS: tag r19-15b103
author cvs
date Mon, 13 Aug 2007 08:54:25 +0200
parents 859a2309aef8
children 131b0175ea99
line wrap: on
line diff
--- a/src/filelock.c	Mon Aug 13 08:54:02 2007 +0200
+++ b/src/filelock.c	Mon Aug 13 08:54:25 2007 +0200
@@ -196,7 +196,11 @@
 void
 lock_file (Lisp_Object fn)
 {
-  /* This function can GC */
+  /* This function can GC. */
+  /* dmoore - and can destroy current_buffer and all sorts of other
+     mean nasty things with pointy teeth.  If you call this make sure
+     you protect things right. */
+
   REGISTER Lisp_Object attack, orig_fn;
   REGISTER char *lfname;
   struct gcpro gcpro1, gcpro2;
@@ -335,6 +339,11 @@
 void
 unlock_file (Lisp_Object fn)
 {
+  /* This function can GC. */
+  /* dmoore - and can destroy current_buffer and all sorts of other
+     mean nasty things with pointy teeth.  If you call this make sure
+     you protect things right. */
+
   REGISTER char *lfname;
   if (NILP (Vlock_directory) || NILP (Vsuperlock_file)) return;
   CHECK_STRING (fn);
@@ -391,9 +400,13 @@
 void
 unlock_all_files (void)
 {
-  REGISTER Lisp_Object tail;
+  /* This function can GC. */
+
+  Lisp_Object tail;
   REGISTER struct buffer *b;
+  struct gcpro gcpro1;
 
+  GCPRO1 (tail);
   for (tail = Vbuffer_alist; GC_CONSP (tail);
        tail = XCDR (tail))
     {
@@ -402,6 +415,7 @@
 	  BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
 	unlock_file (b->file_truename);
     }
+  UNGCPRO;
 }
 
 
@@ -413,6 +427,10 @@
        (fn))
 {
   /* This function can GC */
+  /* dmoore - and can destroy current_buffer and all sorts of other
+     mean nasty things with pointy teeth.  If you call this make sure
+     you protect things right. */
+
   if (NILP (fn))
     fn = current_buffer->file_truename;
   CHECK_STRING (fn);
@@ -428,6 +446,11 @@
 */
        ())
 {
+  /* This function can GC */
+  /* dmoore - and can destroy current_buffer and all sorts of other
+     mean nasty things with pointy teeth.  If you call this make sure
+     you protect things right. */
+
   if (BUF_SAVE_MODIFF (current_buffer) < BUF_MODIFF (current_buffer)
       && STRINGP (current_buffer->file_truename))
     unlock_file (current_buffer->file_truename);
@@ -440,6 +463,10 @@
 void
 unlock_buffer (struct buffer *buffer)
 {
+  /* This function can GC */
+  /* dmoore - and can destroy current_buffer and all sorts of other
+     mean nasty things with pointy teeth.  If you call this make sure
+     you protect things right. */
   if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
       && STRINGP (buffer->file_truename))
     unlock_file (buffer->file_truename);