diff options
| author | Paul Eggert | 2020-03-25 13:37:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-03-25 13:40:34 -0700 |
| commit | 2ea87d6c6f1161801402958bdc6b6a2e6c41c6b8 (patch) | |
| tree | b225e1669bc7bfd9380389dc4422216d6c0efd31 /src | |
| parent | 11b37a4167d2eee4cb1f467a7f8ebaa6c8667ce9 (diff) | |
| download | emacs-2ea87d6c6f1161801402958bdc6b6a2e6c41c6b8.tar.gz emacs-2ea87d6c6f1161801402958bdc6b6a2e6c41c6b8.zip | |
Pacify --enable-gcc-warnings for lock_file
* src/filelock.c (lock_file): Pacify gcc -Wmaybe-uninitialized
after recent change to this function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/filelock.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/filelock.c b/src/filelock.c index 2b734ee00d5..ee46e0e3e00 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -661,7 +661,7 @@ void | |||
| 661 | lock_file (Lisp_Object fn) | 661 | lock_file (Lisp_Object fn) |
| 662 | { | 662 | { |
| 663 | Lisp_Object orig_fn, encoded_fn; | 663 | Lisp_Object orig_fn, encoded_fn; |
| 664 | char *lfname; | 664 | char *lfname = NULL; |
| 665 | lock_info_type lock_info; | 665 | lock_info_type lock_info; |
| 666 | USE_SAFE_ALLOCA; | 666 | USE_SAFE_ALLOCA; |
| 667 | 667 | ||
| @@ -686,21 +686,15 @@ lock_file (Lisp_Object fn) | |||
| 686 | 686 | ||
| 687 | /* See if this file is visited and has changed on disk since it was | 687 | /* See if this file is visited and has changed on disk since it was |
| 688 | visited. */ | 688 | visited. */ |
| 689 | { | 689 | Lisp_Object subject_buf = get_truename_buffer (orig_fn); |
| 690 | register Lisp_Object subject_buf; | 690 | if (!NILP (subject_buf) |
| 691 | 691 | && NILP (Fverify_visited_file_modtime (subject_buf)) | |
| 692 | subject_buf = get_truename_buffer (orig_fn); | 692 | && !NILP (Ffile_exists_p (fn)) |
| 693 | 693 | && !(lfname && current_lock_owner (NULL, lfname) == -2)) | |
| 694 | if (!NILP (subject_buf) | 694 | call1 (intern ("userlock--ask-user-about-supersession-threat"), fn); |
| 695 | && NILP (Fverify_visited_file_modtime (subject_buf)) | ||
| 696 | && !NILP (Ffile_exists_p (fn)) | ||
| 697 | && (!create_lockfiles || current_lock_owner (NULL, lfname) != -2)) | ||
| 698 | call1 (intern ("userlock--ask-user-about-supersession-threat"), fn); | ||
| 699 | |||
| 700 | } | ||
| 701 | 695 | ||
| 702 | /* Don't do locking if the user has opted out. */ | 696 | /* Don't do locking if the user has opted out. */ |
| 703 | if (create_lockfiles) | 697 | if (lfname) |
| 704 | { | 698 | { |
| 705 | /* Try to lock the lock. FIXME: This ignores errors when | 699 | /* Try to lock the lock. FIXME: This ignores errors when |
| 706 | lock_if_free returns a positive errno value. */ | 700 | lock_if_free returns a positive errno value. */ |
| @@ -860,7 +854,7 @@ syms_of_filelock (void) | |||
| 860 | The name of the (per-buffer) lockfile is constructed by prepending a | 854 | The name of the (per-buffer) lockfile is constructed by prepending a |
| 861 | '.#' to the name of the file being locked. See also `lock-buffer' and | 855 | '.#' to the name of the file being locked. See also `lock-buffer' and |
| 862 | Info node `(emacs)Interlocking'. */); | 856 | Info node `(emacs)Interlocking'. */); |
| 863 | create_lockfiles = 1; | 857 | create_lockfiles = true; |
| 864 | 858 | ||
| 865 | defsubr (&Sunlock_buffer); | 859 | defsubr (&Sunlock_buffer); |
| 866 | defsubr (&Slock_buffer); | 860 | defsubr (&Slock_buffer); |