summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-07-24 16:12:20 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-07-24 16:12:20 +0000
commite6979d6e33ad4906fa09d414f0c7393fff306de5 (patch)
tree04bb23e8159204bdef022ebe3095865bc9cbee17 /lisp
parente1ee73a8dab918b902356d5eb40eefc86bb8003c (diff)
downloademacs-e6979d6e33ad4906fa09d414f0c7393fff306de5.tar.gz
(dired-copy-file-recursive): Avoid calling
set-file-modes when creating target directories.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/dired-aux.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 8ebd796c2bd..7c4c29abb23 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1195,9 +1195,13 @@ Special value `always' suppresses confirmation."
(if (file-exists-p to)
(or top (dired-handle-overwrite to))
(condition-case err
- (progn
- (make-directory to)
- (set-file-modes to #o700))
+ ;; Create the directory with correct permissions.
+ (let ((default-mode (default-file-modes)))
+ (unwind-protect
+ (progn
+ (set-default-file-modes #o700)
+ (make-directory to))
+ (set-default-file-modes default-mode)))
(file-error
(push (dired-make-relative from)
dired-create-files-failures)