diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2019-09-16 17:43:56 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-09-16 18:00:59 -0700 |
| commit | bc1c2cf009e30af77523fd87a8910fdbc4284704 (patch) | |
| tree | e825b2ac67c0beb3b43f50ec100eed4c0d93570b /lisp/htmlfontify.el | |
| parent | b124cb8f30d575fcda97507c40f16a499640bcd5 (diff) | |
| download | emacs-bc1c2cf009e30af77523fd87a8910fdbc4284704.tar.gz | |
Fix some file-mode races
* lisp/emacs-lisp/autoload.el (autoload-ensure-file-writeable):
* lisp/files.el (after-find-file):
* lisp/gnus/gnus-start.el (gnus-dribble-read-file):
* lisp/htmlfontify.el (hfy-copy-and-fontify-file):
* lisp/server.el (server-ensure-safe-dir):
Avoid a race when getting file permissions.
Diffstat (limited to 'lisp/htmlfontify.el')
| -rw-r--r-- | lisp/htmlfontify.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index b8442be1e89..c1aaab5e211 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1938,9 +1938,9 @@ adding an extension of `hfy-extn'. Fontification is actually done by (set-buffer html) (write-file (concat target hfy-extn)) (kill-buffer html)) - ;; #o0200 == 128, but emacs20 doesn't know that - (if (and (file-exists-p target) (not (file-writable-p target))) - (set-file-modes target (logior (file-modes target) 128))) + (let ((modes (file-modes target))) + (if (and modes (not (file-writable-p target))) + (set-file-modes target (logior modes #o0200)))) (copy-file (buffer-file-name source) target 'overwrite)) (kill-buffer source)) )) |
