Commit 5f8d6a10 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Vtemporary_file_directory): New variable.

(syms_of_filelock): Set up Lisp variable.

(get_boot_time): Make the temp name in the proper dir.
parent ba1acd68
...@@ -61,6 +61,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -61,6 +61,10 @@ Boston, MA 02111-1307, USA. */
extern int errno; extern int errno;
#endif #endif
/* The directory for writing temporary files. */
Lisp_Object Vtemporary_file_directory;
#ifdef CLASH_DETECTION #ifdef CLASH_DETECTION
#include <utmp.h> #include <utmp.h>
...@@ -195,7 +199,9 @@ get_boot_time () ...@@ -195,7 +199,9 @@ get_boot_time ()
if (! NILP (Ffile_exists_p (tempname))) if (! NILP (Ffile_exists_p (tempname)))
{ {
Lisp_Object args[6]; 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[0] = Vshell_file_name;
args[1] = Qnil; args[1] = Qnil;
args[2] = Qnil; args[2] = Qnil;
...@@ -391,7 +397,7 @@ current_lock_owner (owner, lfname) ...@@ -391,7 +397,7 @@ current_lock_owner (owner, lfname)
#ifndef index #ifndef index
extern char *rindex (), *index (); extern char *rindex (), *index ();
#endif #endif
int o, p, len, ret; int len, ret;
int local_owner = 0; int local_owner = 0;
char *at, *dot, *colon; char *at, *dot, *colon;
char *lfinfo = 0; char *lfinfo = 0;
...@@ -720,6 +726,10 @@ init_filelock () ...@@ -720,6 +726,10 @@ init_filelock ()
void void
syms_of_filelock () 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 (&Sunlock_buffer);
defsubr (&Slock_buffer); defsubr (&Slock_buffer);
defsubr (&Sfile_locked_p); defsubr (&Sfile_locked_p);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment