]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-copy-file-recursive): Avoid calling set-file-modes when
authorChong Yidong <cyd@stupidchicken.com>
Thu, 24 Jul 2008 16:16:00 +0000 (16:16 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 24 Jul 2008 16:16:00 +0000 (16:16 +0000)
creating target directories.

lisp/dired-aux.el

index 407e7296adcfac3d9740e15de39ffbd2f379ab81..a786ed1c90352d0b0f4f82ab20e08ee2e5dcb98b 100644 (file)
@@ -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)