[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112244: Ignore additional platform-s
From: |
Romain Francoise |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112244: Ignore additional platform-specific ACL errors (Bug#13702). |
Date: |
Sun, 07 Apr 2013 13:21:39 +0200 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 112244
committer: Romain Francoise <address@hidden>
branch nick: trunk
timestamp: Sun 2013-04-07 13:21:39 +0200
message:
Ignore additional platform-specific ACL errors (Bug#13702).
* fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
(Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
modified:
src/ChangeLog
src/fileio.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-04-07 10:51:29 +0000
+++ b/src/ChangeLog 2013-04-07 11:21:39 +0000
@@ -1,3 +1,9 @@
+2013-04-07 Romain Francoise <address@hidden>
+
+ Ignore additional platform-specific ACL errors (Bug#13702).
+ * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
+ (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
+
2013-03-31 Jan Djärv <address@hidden>
* nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
=== modified file 'src/fileio.c'
--- a/src/fileio.c 2013-04-07 04:41:19 +0000
+++ b/src/fileio.c 2013-04-07 11:21:39 +0000
@@ -81,6 +81,23 @@
#define DRIVE_LETTER(x) c_tolower (x)
#endif
+#ifdef HAVE_POSIX_ACL
+/* FIXME: this macro was copied from gnulib's private acl-internal.h
+ header file. */
+/* Recognize some common errors such as from an NFS mount that does
+ not support ACLs, even when local drives do. */
+#if defined __APPLE__ && defined __MACH__ /* Mac OS X */
+#define ACL_NOT_WELL_SUPPORTED(Err) \
+ ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY ||
(Err) == ENOENT)
+#elif defined EOPNOTSUPP /* Tru64 NFS */
+#define ACL_NOT_WELL_SUPPORTED(Err) \
+ ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY ||
(Err) == EOPNOTSUPP)
+#else
+#define ACL_NOT_WELL_SUPPORTED(Err) \
+ ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
+#endif
+#endif /* HAVE_POSIX_ACL */
+
#include "systime.h"
#include <allocator.h>
#include <careadlinkat.h>
@@ -2011,7 +2028,7 @@
{
#ifdef HAVE_POSIX_ACL
acl = acl_get_file (SDATA (encoded_file), ACL_TYPE_ACCESS);
- if (acl == NULL && errno != ENOTSUP)
+ if (acl == NULL && !ACL_NOT_WELL_SUPPORTED (errno))
report_file_error ("Getting ACL", Fcons (file, Qnil));
#endif
}
@@ -2055,7 +2072,7 @@
{
bool fail =
acl_set_file (SDATA (encoded_newname), ACL_TYPE_ACCESS, acl) != 0;
- if (fail && errno != ENOTSUP)
+ if (fail && !ACL_NOT_WELL_SUPPORTED (errno))
report_file_error ("Setting ACL", Fcons (newname, Qnil));
acl_free (acl);
@@ -2087,7 +2104,7 @@
#ifdef HAVE_POSIX_ACL
acl = acl_get_fd (ifd);
- if (acl == NULL && errno != ENOTSUP)
+ if (acl == NULL && !ACL_NOT_WELL_SUPPORTED (errno))
report_file_error ("Getting ACL", Fcons (file, Qnil));
#endif
}
@@ -2176,7 +2193,7 @@
if (acl != NULL)
{
bool fail = acl_set_fd (ofd, acl) != 0;
- if (fail && errno != ENOTSUP)
+ if (fail && !ACL_NOT_WELL_SUPPORTED (errno))
report_file_error ("Setting ACL", Fcons (newname, Qnil));
acl_free (acl);
@@ -3174,7 +3191,7 @@
fail = (acl_set_file (SSDATA (encoded_absname), ACL_TYPE_ACCESS,
acl)
!= 0);
- if (fail && errno != ENOTSUP)
+ if (fail && !ACL_NOT_WELL_SUPPORTED (errno))
report_file_error ("Setting ACL", Fcons (absname, Qnil));
acl_free (acl);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112244: Ignore additional platform-specific ACL errors (Bug#13702).,
Romain Francoise <=