apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/file_io/unix dir.c
Date Sun, 15 Dec 2002 03:24:34 GMT
rbb         2002/12/14 19:24:34

  Modified:    file_io/unix dir.c
  Log:
  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.
  
  Revision  Changes    Path
  1.68      +11 -0     apr/file_io/unix/dir.c
  
  Index: dir.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/dir.c,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- dir.c	15 Dec 2002 02:00:22 -0000	1.67
  +++ dir.c	15 Dec 2002 03:24:34 -0000	1.68
  @@ -183,6 +183,17 @@
        */
       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
  
  
  

Mime
View raw message