apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/file_io/unix filestat.c
Date Sat, 27 Jan 2001 06:41:07 GMT
wrowe       01/01/26 22:41:07

  Modified:    file_io/unix filestat.c
  Log:
    Clean up some uglyness ... here's what the flags now mean:
  
    info->type & APR_FINFO_LINK - ok, we looked for a link
    info->filetype == APR_LNK   - yup, we got a link
  
    This is likely why unix users were reporting 'unexpected'
    APR_INCOMPLETE return values.
  
  Revision  Changes    Path
  1.42      +8 -12     apr/file_io/unix/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/filestat.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- filestat.c	2001/01/24 21:11:52	1.41
  +++ filestat.c	2001/01/27 06:41:07	1.42
  @@ -81,8 +81,8 @@
       return type;
   }
   
  -static apr_status_t fill_out_finfo(apr_finfo_t *finfo, struct stat *info,
  -                                   apr_int32_t wanted)
  +static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info,
  +                           apr_int32_t wanted)
   { 
       finfo->valid = APR_FINFO_MIN | APR_FINFO_IDENT | APR_FINFO_NLINK
                    | APR_FINFO_OWNER | APR_FINFO_PROT;
  @@ -103,14 +103,6 @@
        *   finfo->valid |= APR_FINFO_CSIZE;
        * }
        */
  -    if (finfo->filetype == APR_LNK) {
  -        finfo->valid |= APR_FINFO_LINK;
  -    }
  -
  -    if (wanted & ~finfo->valid)
  -        return APR_INCOMPLETE;
  -
  -    return APR_SUCCESS;
   }
   
   apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_int32_t wanted,
  @@ -121,7 +113,8 @@
       if (fstat(thefile->filedes, &info) == 0) {
           finfo->cntxt = thefile->cntxt;
           finfo->fname = thefile->fname;
  -        return fill_out_finfo(finfo, &info, wanted);
  +        fill_out_finfo(finfo, &info, wanted);
  +        return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
       }
       else {
           return errno;
  @@ -151,7 +144,10 @@
       if (srv == 0) {
           finfo->cntxt = cont;
           finfo->fname = fname;
  -        return fill_out_finfo(finfo, &info, wanted);
  +        fill_out_finfo(finfo, &info, wanted);
  +        if (wanted & APR_FINFO_LINK)
  +            wanted &= ~APR_FINFO_LINK;
  +        return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
       }
       else {
   #if !defined(ENOENT) || !defined(ENOTDIR)
  
  
  

Mime
View raw message