summaryrefslogtreecommitdiff
path: root/src/filelock.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-09-16 19:34:38 +0000
committerRichard M. Stallman <rms@gnu.org>1999-09-16 19:34:38 +0000
commit5f8d6a1075d8d8ef46e4a71aff291281d862a9f0 (patch)
tree10052c800b9d2abfa4182215fd47943ff72e3312 /src/filelock.c
parentba1acd68768ac49d98afbf781851ab95c0263048 (diff)
downloademacs-5f8d6a1075d8d8ef46e4a71aff291281d862a9f0.tar.gz
(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/filelock.c')
-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. */
extern int errno;
#endif
+/* The directory for writing temporary files. */
+
+Lisp_Object Vtemporary_file_directory;
+
#ifdef CLASH_DETECTION
#include <utmp.h>
@@ -195,7 +199,9 @@ get_boot_time ()
if (! NILP (Ffile_exists_p (tempname)))
{
Lisp_Object args[6];
- tempname = Fmake_temp_name (build_string ("wtmp"));
+ tempname = Fexpand_file_name (build_string ("wtmp"),
+ Vtemporary_file_directory);
+ tempname = Fmake_temp_name (tempname);
args[0] = Vshell_file_name;
args[1] = Qnil;
args[2] = Qnil;
@@ -391,7 +397,7 @@ current_lock_owner (owner, lfname)
#ifndef index
extern char *rindex (), *index ();
#endif
- int o, p, len, ret;
+ int len, ret;
int local_owner = 0;
char *at, *dot, *colon;
char *lfinfo = 0;
@@ -720,6 +726,10 @@ init_filelock ()
void
syms_of_filelock ()
{
+ DEFVAR_LISP ("temporary-file-directory", &Vtemporary_file_directory,
+ "The directory for writing temporary files.");
+ Vtemporary_file_directory = Qnil;
+
defsubr (&Sunlock_buffer);
defsubr (&Slock_buffer);
defsubr (&Sfile_locked_p);