summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-07-24 16:16:00 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-07-24 16:16:00 +0000
commita1a7c9ab3c8c30b65dec9ec453c475ffa2971684 (patch)
tree86e7dc055e32340ddb7bee1e726d34bd5784519e
parent06697685761722ac5f29280a0019a99f1fc7aa5c (diff)
downloademacs-a1a7c9ab3c8c30b65dec9ec453c475ffa2971684.tar.gz
(dired-copy-file-recursive): Avoid calling set-file-modes when
creating target directories.
-rw-r--r--lisp/dired-aux.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 407e7296adc..a786ed1c903 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1180,9 +1180,15 @@ 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))
+ ;; We used to call set-file-modes here, but on some
+ ;; Linux kernels, that returns an error on vfat
+ ;; filesystems
+ (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)