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/win32 filestat.c dir.c
Date Mon, 12 Nov 2001 16:58:37 GMT
wrowe       01/11/12 08:58:37

  Modified:    include/arch/win32 fileio.h
               file_io/win32 filestat.c dir.c
  Log:
    This is a fix for the SymLink tests on Win2k, that is required by the
    recent fixes to request.c (probably required before that, as well.)
  
  Revision  Changes    Path
  1.59      +1 -1      apr/include/arch/win32/fileio.h
  
  Index: fileio.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/win32/fileio.h,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- fileio.h	2001/09/10 19:05:59	1.58
  +++ fileio.h	2001/11/12 16:58:37	1.59
  @@ -156,7 +156,7 @@
   
   /* Private function for apr_stat/lstat/getfileinfo/dir_read */
   int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, 
  -                    int byhandle);
  +                    int byhandle, apr_int32_t wanted);
   
   /* Private function that extends apr_stat/lstat/getfileinfo/dir_read */
   apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, 
  
  
  
  1.57      +14 -5     apr/file_io/win32/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/win32/filestat.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- filestat.c	2001/09/05 04:43:28	1.56
  +++ filestat.c	2001/11/12 16:58:37	1.57
  @@ -297,7 +297,7 @@
    */
   int fillin_fileinfo(apr_finfo_t *finfo, 
                       WIN32_FILE_ATTRIBUTE_DATA *wininfo, 
  -                    int byhandle) 
  +                    int byhandle, apr_int32_t wanted) 
   {
       DWORD *sizes = &wininfo->nFileSizeHigh + byhandle;
       int warn = 0;
  @@ -349,12 +349,19 @@
       
       finfo->valid = APR_FINFO_ATIME | APR_FINFO_CTIME | APR_FINFO_MTIME
                    | APR_FINFO_SIZE  | APR_FINFO_TYPE;   /* == APR_FINFO_MIN */
  +
  +    /* Only byhandle optionally tests link targets, so tell that caller
  +     * what it wants to hear, otherwise the byattributes is never
  +     * reporting anything but the link.
  +     */
  +    if (!byhandle || (wanted & APR_FINFO_LINK))
  +        finfo->valid |= APR_FINFO_LINK;
       return warn;
   }
   
   
   APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted,
  -                                          apr_file_t *thefile)
  +                                            apr_file_t *thefile)
   {
       BY_HANDLE_FILE_INFORMATION FileInfo;
   
  @@ -362,7 +369,7 @@
           return apr_get_os_error();
       }
   
  -    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1);
  +    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 1, wanted);
   
       if (finfo->filetype == APR_REG)
       {
  @@ -510,7 +517,8 @@
               finfo->protection |= APR_WREAD | APR_WEXECUTE | APR_WWRITE;
               finfo->protection |= (finfo->protection << prot_scope_group) 
                                  | (finfo->protection << prot_scope_user);
  -            finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_MTIME;
  +            finfo->valid |= APR_FINFO_TYPE | APR_FINFO_PROT | APR_FINFO_MTIME
  +                         | (wanted & APR_FINFO_LINK);
               return (wanted &= ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;   
        
           }
           else
  @@ -533,7 +541,8 @@
       }
   
       if (ident_rv != APR_INCOMPLETE) {
  -        if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 0))
  +        if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) &FileInfo, 
  +                            0, wanted))
           {
               /* Go the extra mile to assure we have a file.  WinNT/2000 seems
                * to reliably translate char devices to the path '\\.\device'
  
  
  
  1.60      +2 -1      apr/file_io/win32/dir.c
  
  Index: dir.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/win32/dir.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- dir.c	2001/08/07 19:57:44	1.59
  +++ dir.c	2001/11/12 16:58:37	1.60
  @@ -213,7 +213,8 @@
           fname = thedir->n.entry->cFileName;
       }
   
  -    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 0);
  +    fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) thedir->w.entry, 
  +                    0, wanted);
       finfo->cntxt = thedir->cntxt;
   
       finfo->valid |= APR_FINFO_NAME;
  
  
  

Mime
View raw message