comparison src/filelock.c @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 2d532a89d707
children 966663fcf606
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
37 37
38 /* FSFmacs uses char *lock_dir and char *superlock_file instead of 38 /* FSFmacs uses char *lock_dir and char *superlock_file instead of
39 the Lisp variables we use. */ 39 the Lisp variables we use. */
40 40
41 /* The name of the directory in which we keep lock files, with a '/' 41 /* The name of the directory in which we keep lock files, with a '/'
42 appended. */ 42 appended. */
43 Lisp_Object Vlock_directory; 43 Lisp_Object Vlock_directory;
44 44
45 #if 0 /* FSFmacs */ 45 #if 0 /* FSFmacs */
46 /* Look in startup.el */ 46 /* Look in startup.el */
47 /* The name of the file in the lock directory which is used to 47 /* The name of the file in the lock directory which is used to
83 unsigned char byte [8]; 83 unsigned char byte [8];
84 } crc; 84 } crc;
85 REGISTER unsigned char *p, new; 85 REGISTER unsigned char *p, new;
86 86
87 CHECK_STRING (Vlock_directory); 87 CHECK_STRING (Vlock_directory);
88 88
89 /* 7-bytes cyclic code for burst correction on byte-by-byte basis. 89 /* 7-bytes cyclic code for burst correction on byte-by-byte basis.
90 the used polynomial is D^7 + D^6 + D^3 +1. pot@cnuce.cnr.it */ 90 the used polynomial is D^7 + D^6 + D^3 +1. pot@cnuce.cnr.it */
91 91
92 crc.word[0] = crc.word[1] = 0; 92 crc.word[0] = crc.word[1] = 0;
93 93
440 fn = current_buffer->file_truename; 440 fn = current_buffer->file_truename;
441 CHECK_STRING (fn); 441 CHECK_STRING (fn);
442 if (BUF_SAVE_MODIFF (current_buffer) < BUF_MODIFF (current_buffer) 442 if (BUF_SAVE_MODIFF (current_buffer) < BUF_MODIFF (current_buffer)
443 && !NILP (fn)) 443 && !NILP (fn))
444 lock_file (fn); 444 lock_file (fn);
445 return Qnil; 445 return Qnil;
446 } 446 }
447 447
448 DEFUN ("unlock-buffer", Funlock_buffer, 0, 0, 0, /* 448 DEFUN ("unlock-buffer", Funlock_buffer, 0, 0, 0, /*
449 Unlock the file visited in the current buffer, 449 Unlock the file visited in the current buffer,
450 if it should normally be locked. 450 if it should normally be locked.
498 owner = current_lock_owner (lfname); 498 owner = current_lock_owner (lfname);
499 if (owner <= 0) 499 if (owner <= 0)
500 return (Qnil); 500 return (Qnil);
501 else if (owner == getpid ()) 501 else if (owner == getpid ())
502 return (Qt); 502 return (Qt);
503 503
504 return (lock_file_owner_name (lfname)); 504 return (lock_file_owner_name (lfname));
505 } 505 }
506 506
507 void 507 void
508 syms_of_filelock (void) 508 syms_of_filelock (void)