aboutsummaryrefslogtreecommitdiffstats
path: root/src/filelock.c
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 12:42:16 -0400
committerStefan Monnier2011-03-21 12:42:16 -0400
commitcafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch)
tree7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/filelock.c
parenta08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff)
parent4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff)
downloademacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz
emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip
Merge from trunk
Diffstat (limited to 'src/filelock.c')
-rw-r--r--src/filelock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/filelock.c b/src/filelock.c
index 7f8f0e1c0fb..2138eaa502b 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -344,13 +344,13 @@ static int
344lock_file_1 (char *lfname, int force) 344lock_file_1 (char *lfname, int force)
345{ 345{
346 register int err; 346 register int err;
347 time_t boot_time; 347 time_t boot;
348 const char *user_name; 348 const char *user_name;
349 const char *host_name; 349 const char *host_name;
350 char *lock_info_str; 350 char *lock_info_str;
351 351
352 /* Call this first because it can GC. */ 352 /* Call this first because it can GC. */
353 boot_time = get_boot_time (); 353 boot = get_boot_time ();
354 354
355 if (STRINGP (Fuser_login_name (Qnil))) 355 if (STRINGP (Fuser_login_name (Qnil)))
356 user_name = SSDATA (Fuser_login_name (Qnil)); 356 user_name = SSDATA (Fuser_login_name (Qnil));
@@ -363,9 +363,9 @@ lock_file_1 (char *lfname, int force)
363 lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) 363 lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
364 + LOCK_PID_MAX + 30); 364 + LOCK_PID_MAX + 30);
365 365
366 if (boot_time) 366 if (boot)
367 sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name, 367 sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name,
368 (unsigned long) getpid (), (unsigned long) boot_time); 368 (unsigned long) getpid (), (unsigned long) boot);
369 else 369 else
370 sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name, 370 sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name,
371 (unsigned long) getpid ()); 371 (unsigned long) getpid ());
@@ -382,7 +382,7 @@ lock_file_1 (char *lfname, int force)
382 382
383/* Return 1 if times A and B are no more than one second apart. */ 383/* Return 1 if times A and B are no more than one second apart. */
384 384
385int 385static int
386within_one_second (time_t a, time_t b) 386within_one_second (time_t a, time_t b)
387{ 387{
388 return (a - b >= -1 && a - b <= 1); 388 return (a - b >= -1 && a - b <= 1);