Mercurial > hg > xemacs-beta
diff src/filelock.c @ 114:8619ce7e4c50 r20-1b9
Import from CVS: tag r20-1b9
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:21:54 +0200 |
parents | 4be1180a9e89 |
children | 3bb7ccffb0c0 |
line wrap: on
line diff
--- a/src/filelock.c Mon Aug 13 09:20:50 2007 +0200 +++ b/src/filelock.c Mon Aug 13 09:21:54 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; @@ -337,6 +341,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); @@ -395,9 +404,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)) { @@ -406,6 +419,7 @@ BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) unlock_file (b->file_truename); } + UNGCPRO; } @@ -417,6 +431,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); @@ -432,6 +450,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); @@ -444,6 +467,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);