diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-10-19 10:04:50 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-10-19 10:04:50 +0300 |
commit | f1575763c0d30df9f9e5b730c2f2c68f501cda9c (patch) | |
tree | a2c64b716d9255f8bc3724def456834f5820902c /lisp | |
parent | 552482d41d88fb231ae6cc4857f3050f96710d02 (diff) | |
download | emacs-f1575763c0d30df9f9e5b730c2f2c68f501cda9c.tar.gz emacs-f1575763c0d30df9f9e5b730c2f2c68f501cda9c.tar.bz2 emacs-f1575763c0d30df9f9e5b730c2f2c68f501cda9c.zip |
Fix return value of 'set-file-extended-attributes'
* lisp/files.el (set-file-extended-attributes): Return non-nil
when setting either ACLs or SELinux context succeeds. Document
the return value. (Bug#21699)
* doc/lispref/files.texi (Changing Files): Document the return
value of set-file-extended-attributes.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/files.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/files.el b/lisp/files.el index 8565aa83266..d0e3e6886f0 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4055,14 +4055,19 @@ such as SELinux context, list of ACL entries, etc." "Set extended attributes of file FILENAME to ATTRIBUTES. ATTRIBUTES must be an alist of file attributes as returned by -`file-extended-attributes'." - (dolist (elt attributes) - (let ((attr (car elt)) - (val (cdr elt))) - (cond ((eq attr 'acl) - (set-file-acl filename val)) - ((eq attr 'selinux-context) - (set-file-selinux-context filename val)))))) +`file-extended-attributes'. +Value is t if the function succeeds in setting the attributes." + (let (result rv) + (dolist (elt attributes) + (let ((attr (car elt)) + (val (cdr elt))) + (cond ((eq attr 'acl) + (setq rv (set-file-acl filename val))) + ((eq attr 'selinux-context) + (setq rv (set-file-selinux-context filename val)))) + (setq result (or result rv)))) + + result)) (defun backup-buffer () "Make a backup of the disk file visited by the current buffer, if appropriate. |