* \param func The function to call for each entry.
* \param private_data Pointer to an arbitrary data structure.
*
- * For each regular file in \a dirname, the supplied function \a func is
+ * For each regular file under \a dirname, the supplied function \a func is
* called. The full path of the regular file and the \a private_data pointer
- * are passed to \a func.
+ * are passed to \a func. Directories for which the calling process has no
+ * permissions to change to are silently ignored.
*
* \return On success, 1 is returned. Otherwise, this function returns a
* negative value which indicates the kind of the error.
int cwd_fd, ret2, ret = para_opendir(dirname, &dir, &cwd_fd);
if (ret < 0)
- return ret;
+ return ret == -E_CHDIR_PERM? 1 : ret;
/* scan cwd recursively */
while ((entry = readdir(dir))) {
mode_t m;