- if ((stat(path, &st)) != 0)
- return -1;
- if (S_ISDIR(st.st_mode)) {
- len = snprintf(buf, MAXPATHLEN, "%s/.AppleDouble",path);
- if (len < 0 || len >= MAXPATHLEN)
- return -1;
- /* set acl on .AppleDouble dir first */
- if ((acl(buf, cmd, count, aces)) != 0)
- return -1;
- /* now set ACL on ressource fork */
- if ((acl(vol->ad_path(path, ADFLAGS_DIR), cmd, count, aces)) != 0)
- return -1;
- } else
- /* set ACL on ressource fork */
- if ((acl(vol->ad_path(path, ADFLAGS_HF), cmd, count, aces)) != 0)
- return -1;
-
- return 0;
+ if ((stat(path, &st)) != 0) {
+ if (errno == ENOENT)
+ return AFP_OK;
+ return AFPERR_MISC;
+ }
+ if (!S_ISDIR(st.st_mode)) {
+ /* set ACL on ressource fork */
+ if ((acl(vol->ad_path(path, ADFLAGS_HF), cmd, count, aces)) != 0)
+ return AFPERR_MISC;
+ }
+ return AFP_OK;