+2015-07-03 Jim Meyering <meyering@fb.com>
+
+ set-permissions.c: adjust acl_from_mode's cpp guard
+ * lib/set-permissions.c (acl_from_mode): Guard with #ifdef
+ directives identical to those guarding the sole use.
+ Otherwise, on some systems, we'd get a warning about
+ the function being defined but not used.
+ Also, filter through cppi to correct misleading indentation
+ of cpp directives.
+
2015-07-03 Pádraig Brady <P@draigBrady.com>
tests: restrict shells to those that support 'local'
#if USE_ACL
# if ! defined HAVE_ACL_FROM_MODE && defined HAVE_ACL_FROM_TEXT /* FreeBSD, IRIX, Tru64 */
+# if HAVE_ACL_GET_FILE && !HAVE_ACL_TYPE_EXTENDED
+
static acl_t
acl_from_mode (mode_t mode)
{
return acl_from_text (acl_text);
}
+# endif
# endif
# if HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */
}
}
-#elif HAVE_GETACL /* HP-UX */
+# elif HAVE_GETACL /* HP-UX */
static int
context_acl_from_mode (struct permission_context *ctx, const char *name, int desc)
{
abort ();
return ret;
}
-#endif
+# endif
# elif HAVE_ACLX_GET && defined ACL_AIX_WIP /* AIX */
static int
{
int ret = 0;
-#if HAVE_ACL_GET_FILE
+# if HAVE_ACL_GET_FILE
/* POSIX 1003.1e (draft 17 -- abandoned) specific version. */
/* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */
# if !HAVE_ACL_TYPE_EXTENDED
/* Linux, FreeBSD, IRIX, Tru64 */
-# ifndef HAVE_ACL_FROM_TEXT
-# error Must have acl_from_text (see POSIX 1003.1e draft 17).
-# endif
-# ifndef HAVE_ACL_DELETE_DEF_FILE
-# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17).
-# endif
+# ifndef HAVE_ACL_FROM_TEXT
+# error Must have acl_from_text (see POSIX 1003.1e draft 17).
+# endif
+# ifndef HAVE_ACL_DELETE_DEF_FILE
+# error Must have acl_delete_def_file (see POSIX 1003.1e draft 17).
+# endif
if (! ctx->acls_not_supported)
{
else
*acls_set = true;
}
-# endif
+# endif
-#elif HAVE_GETACL /* HP-UX */
+# elif HAVE_GETACL /* HP-UX */
if (from_mode)
ret = context_acl_from_mode (ctx, name, desc);
/* Nothing to do. */
-#endif
+# endif
return ret;
}