diff options
| author | Andreas Schwab | 2004-11-27 22:09:40 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2004-11-27 22:09:40 +0000 |
| commit | 4ba93ac05d20ea926b077237900dd92962aaeba4 (patch) | |
| tree | 45e59eb38796981b527e6c2ffa13929cecaadf14 /src | |
| parent | 94221759560ce496449f87fff47cd0b501f7965d (diff) | |
| download | emacs-4ba93ac05d20ea926b077237900dd92962aaeba4.tar.gz emacs-4ba93ac05d20ea926b077237900dd92962aaeba4.zip | |
(lock_file_1): Call get_boot_time early. Increase
buffer size.
Diffstat (limited to 'src')
| -rw-r--r-- | src/filelock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/filelock.c b/src/filelock.c index cbf3f860a92..84540f79330 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -377,6 +377,9 @@ lock_file_1 (lfname, force) | |||
| 377 | char *host_name; | 377 | char *host_name; |
| 378 | char *lock_info_str; | 378 | char *lock_info_str; |
| 379 | 379 | ||
| 380 | /* Call this first because it can GC. */ | ||
| 381 | boot_time = get_boot_time (); | ||
| 382 | |||
| 380 | if (STRINGP (Fuser_login_name (Qnil))) | 383 | if (STRINGP (Fuser_login_name (Qnil))) |
| 381 | user_name = (char *)SDATA (Fuser_login_name (Qnil)); | 384 | user_name = (char *)SDATA (Fuser_login_name (Qnil)); |
| 382 | else | 385 | else |
| @@ -386,9 +389,8 @@ lock_file_1 (lfname, force) | |||
| 386 | else | 389 | else |
| 387 | host_name = ""; | 390 | host_name = ""; |
| 388 | lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) | 391 | lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) |
| 389 | + LOCK_PID_MAX + 5); | 392 | + LOCK_PID_MAX + 30); |
| 390 | 393 | ||
| 391 | boot_time = get_boot_time (); | ||
| 392 | if (boot_time) | 394 | if (boot_time) |
| 393 | sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name, | 395 | sprintf (lock_info_str, "%s@%s.%lu:%lu", user_name, host_name, |
| 394 | (unsigned long) getpid (), (unsigned long) boot_time); | 396 | (unsigned long) getpid (), (unsigned long) boot_time); |