]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - osl.c
for_each_file_in_dir(): Ignore permission errors for subdirectories.
[paraslash.git] / osl.c
diff --git a/osl.c b/osl.c
index 6e3eeca65db2a07d308f0fd2a30995867b29dbc9..0b14447b296c736ecaed7d831e0801a45c99296f 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -211,9 +211,10 @@ out:
  * \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.
@@ -226,7 +227,7 @@ int for_each_file_in_dir(const char *dirname,
        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;