/*
- * $Id: filedir.c,v 1.59 2009-10-16 00:15:53 didg Exp $
+ * $Id: filedir.c,v 1.60 2009-10-23 17:35:06 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
} else if (of_findname(s_path)) {
rc = AFPERR_BUSY;
} else {
- rc = deletefile(vol, upath, 1);
+ /* it's a file st_valid should always be true
+ * only test for ENOENT because EACCES needs
+ * to read meta data in deletefile
+ */
+ if (s_path->st_valid && s_path->st_errno == ENOENT) {
+ rc = AFPERR_NOOBJ;
+ }
+ else {
+ rc = deletefile(vol, upath, 1);
+ }
}
if ( rc == AFP_OK ) {
curdir->offcnt--;