/* D E B U G F U N C T I O N S yaffs_n_handles() Returns number of handles attached to the object  */
int yaffs_n_handles(const YCHAR *path)
/* D E B U G F U N C T I O N S yaffs_n_handles() Returns number of handles attached to the object  */
int yaffs_n_handles(const YCHAR *path)
{
	struct yaffs_obj *obj;
	if (!path) {
		yaffsfs_SetError(-EFAULT);
		return -1;
	}
	if (yaffsfs_CheckPath(path) < 0) {
		yaffsfs_SetError(-ENAMETOOLONG);
		return -1;
	}
	obj = yaffsfs_FindObject(NULL, path, 0, 1, NULL, NULL, NULL);
	if (obj)
		return yaffsfs_CountHandles(obj);
	else
		return -1;
}