aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-09-16 19:34:38 +0000
committerRichard M. Stallman1999-09-16 19:34:38 +0000
commit5f8d6a1075d8d8ef46e4a71aff291281d862a9f0 (patch)
tree10052c800b9d2abfa4182215fd47943ff72e3312 /src
parentba1acd68768ac49d98afbf781851ab95c0263048 (diff)
downloademacs-5f8d6a1075d8d8ef46e4a71aff291281d862a9f0.tar.gz
emacs-5f8d6a1075d8d8ef46e4a71aff291281d862a9f0.zip
(Vtemporary_file_directory): New variable.
(syms_of_filelock): Set up Lisp variable. (get_boot_time): Make the temp name in the proper dir.
Diffstat (limited to 'src')
-rw-r--r--src/filelock.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/filelock.c b/src/filelock.c
index 241835221d1..ec3fa3cf48c 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -61,6 +61,10 @@ Boston, MA 02111-1307, USA. */
61extern int errno; 61extern int errno;
62#endif 62#endif
63 63
64/* The directory for writing temporary files. */
65
66Lisp_Object Vtemporary_file_directory;
67
64#ifdef CLASH_DETECTION 68#ifdef CLASH_DETECTION
65 69
66#include <utmp.h> 70#include <utmp.h>
@@ -195,7 +199,9 @@ get_boot_time ()
195 if (! NILP (Ffile_exists_p (tempname))) 199 if (! NILP (Ffile_exists_p (tempname)))
196 { 200 {
197 Lisp_Object args[6]; 201 Lisp_Object args[6];
198 tempname = Fmake_temp_name (build_string ("wtmp")); 202 tempname = Fexpand_file_name (build_string ("wtmp"),
203 Vtemporary_file_directory);
204 tempname = Fmake_temp_name (tempname);
199 args[0] = Vshell_file_name; 205 args[0] = Vshell_file_name;
200 args[1] = Qnil; 206 args[1] = Qnil;
201 args[2] = Qnil; 207 args[2] = Qnil;
@@ -391,7 +397,7 @@ current_lock_owner (owner, lfname)
391#ifndef index 397#ifndef index
392 extern char *rindex (), *index (); 398 extern char *rindex (), *index ();
393#endif 399#endif
394 int o, p, len, ret; 400 int len, ret;
395 int local_owner = 0; 401 int local_owner = 0;
396 char *at, *dot, *colon; 402 char *at, *dot, *colon;
397 char *lfinfo = 0; 403 char *lfinfo = 0;
@@ -720,6 +726,10 @@ init_filelock ()
720void 726void
721syms_of_filelock () 727syms_of_filelock ()
722{ 728{
729 DEFVAR_LISP ("temporary-file-directory", &Vtemporary_file_directory,
730 "The directory for writing temporary files.");
731 Vtemporary_file_directory = Qnil;
732
723 defsubr (&Sunlock_buffer); 733 defsubr (&Sunlock_buffer);
724 defsubr (&Slock_buffer); 734 defsubr (&Slock_buffer);
725 defsubr (&Sfile_locked_p); 735 defsubr (&Sfile_locked_p);