diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2002-12-15 03:24:34 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2002-12-15 03:24:34 +0000 |
commit | 4c88f0304f86872d93cde719a14f9d26afb2ed60 (patch) | |
tree | 86c1efe6732d11eba214ed6facbd8662f644c4a7 /file_io | |
parent | 7c192b1e0e909780789d769e82df42315641e23e (diff) | |
download | libapr-4c88f0304f86872d93cde719a14f9d26afb2ed60.tar.gz |
Solaris is a bit strange, if there are no more entries in the
directory, it returns EINVAL. Since this is against POSIX, we
hack around the problem here. EINVAL is possible from other
readdir implementations, but only if the result buffer is too small.
since we control the size of that buffer, we should never have
that problem.
With this change Solaris passes all directory tests.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/unix/dir.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c index c38e303b9..a802717a1 100644 --- a/file_io/unix/dir.c +++ b/file_io/unix/dir.c @@ -183,6 +183,17 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, */ if(!ret && thedir->entry != retent) ret = APR_ENOENT; + + /* Solaris is a bit strange, if there are no more entries in the + * directory, it returns EINVAL. Since this is against POSIX, we + * hack around the problem here. EINVAL is possible from other + * readdir implementations, but only if the result buffer is too small. + * since we control the size of that buffer, we should never have + * that problem. + */ + if (ret == EINVAL) { + ret = ENOENT; + } #else /* We're about to call a non-thread-safe readdir() that may possibly set `errno', and the logic below actually cares about |