- aclent_t *entries;
-
- for (;;)
- {
- count = acl (name, GETACLCNT, 0, NULL);
-
- if (count < 0)
- {
- if (errno == ENOSYS || errno == ENOTSUP)
- break;
- else
- return -1;
- }
-
- if (count == 0)
- break;
-
- /* Don't use MIN_ACL_ENTRIES: It's set to 4 on Cygwin, but Cygwin
- returns only 3 entries for files with no ACL. But this is safe:
- If there are more than 4 entries, there cannot be only the
- "user::", "group::", "other:", and "mask:" entries. */
- if (count > 4)
- return 1;
-
- entries = (aclent_t *) malloc (count * sizeof (aclent_t));
- if (entries == NULL)
- {
- errno = ENOMEM;
- return -1;
- }
- if (acl (name, GETACL, count, entries) == count)
- {
- if (acl_nontrivial (count, entries))
- {
- free (entries);
- return 1;
- }
- free (entries);
- break;
- }
- /* Huh? The number of ACL entries changed since the last call.
- Repeat. */
- free (entries);
- }
+ aclent_t *entries;
+
+ for (;;)
+ {
+ count = acl (name, GETACLCNT, 0, NULL);
+
+ if (count < 0)
+ {
+ if (errno == ENOSYS || errno == ENOTSUP)
+ break;
+ else
+ return -1;
+ }
+
+ if (count == 0)
+ break;
+
+ /* Don't use MIN_ACL_ENTRIES: It's set to 4 on Cygwin, but Cygwin
+ returns only 3 entries for files with no ACL. But this is safe:
+ If there are more than 4 entries, there cannot be only the
+ "user::", "group::", "other:", and "mask:" entries. */
+ if (count > 4)
+ return 1;
+
+ entries = (aclent_t *) malloc (count * sizeof (aclent_t));
+ if (entries == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ if (acl (name, GETACL, count, entries) == count)
+ {
+ if (acl_nontrivial (count, entries))
+ {
+ free (entries);
+ return 1;
+ }
+ free (entries);
+ break;
+ }
+ /* Huh? The number of ACL entries changed since the last call.
+ Repeat. */
+ free (entries);
+ }