Move some declarations from acl.h to acl-internal.h.
authorBruno Haible <bruno@clisp.org>
Thu, 22 May 2008 22:14:21 +0000 (00:14 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 22 May 2008 22:14:21 +0000 (00:14 +0200)
ChangeLog
lib/acl-internal.h
lib/acl.h

index 1c11e4a..9bbd1e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-05-22  Bruno Haible  <bruno@clisp.org>
 
+       * lib/acl.h: Don't include <sys/acl.h>.
+       (GETACLCNT): Move fallback to lib/acl-internal.h.
+       * lib/acl-internal.h: Include <sys/acl.h> here.
+       (GETACLCNT): New macro fallback, moved here from lib/acl.h.
+
+2008-05-22  Bruno Haible  <bruno@clisp.org>
+
        Split off copy_acl function to separate file.
        * lib/copy-acl.c: New file, extracted from lib/acl.c.
        * lib/acl.c (copy_acl): Moved function to separate file.
index 36b9ced..c23d6f4 100644 (file)
@@ -1,6 +1,6 @@
 /* Internal implementation of access control lists.
 
-   Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <stdbool.h>
 #include <stdlib.h>
 
+/* All systems define the ACL related API in <sys/acl.h>.  */
+#if HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif
+#if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT
+# define GETACLCNT ACL_CNT
+#endif
+
+/* On Linux, additional ACL related API is available in <acl/libacl.h>.  */
 #ifdef HAVE_ACL_LIBACL_H
 # include <acl/libacl.h>
 #endif
index 00cc60d..fcb00f5 100644 (file)
--- a/lib/acl.h
+++ b/lib/acl.h
@@ -1,6 +1,6 @@
 /* acl.c - access control lists
 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Written by Paul Eggert.  */
 
 #include <sys/types.h>
-
-#if HAVE_SYS_ACL_H
-# include <sys/acl.h>
-#endif
-#if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT
-# define GETACLCNT ACL_CNT
-#endif
-
 #include <sys/stat.h>
 
 int file_has_acl (char const *, struct stat const *);