changeset 58592:7c0aad26b8bb

(lock_file_1): Call get_boot_time early. Increase buffer size.
author Andreas Schwab <schwab@suse.de>
date Sat, 27 Nov 2004 22:09:40 +0000
parents 3dd11351fa53
children ff0c144203a1
files src/filelock.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/filelock.c	Sat Nov 27 19:05:06 2004 +0000
+++ b/src/filelock.c	Sat Nov 27 22:09:40 2004 +0000
@@ -377,6 +377,9 @@
   char *host_name;
   char *lock_info_str;
 
+  /* Call this first because it can GC.  */
+  boot_time = get_boot_time ();
+
   if (STRINGP (Fuser_login_name (Qnil)))
     user_name = (char *)SDATA (Fuser_login_name (Qnil));
   else
@@ -386,9 +389,8 @@
   else
     host_name = "";
   lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
-				  + LOCK_PID_MAX + 5);
+				  + LOCK_PID_MAX + 30);
 
-  boot_time = get_boot_time ();
   if (boot_time)
     sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name,
 	     (unsigned long) getpid (), (unsigned long) boot_time);