apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@xbc.nu>
Subject Unused Win32 apr_file_open flags?
Date Fri, 04 Jul 2003 01:01:59 GMT
In include/arch/win32/apr_arch_file_io.h, we have the following definitions:

/* Internal Flags for apr_file_open */
#define APR_OPENINFO     0x4000    /* Open without READ or WRITE access */
#define APR_OPENLINK     0x2000    /* Open a link itself, if supported */
#define APR_READCONTROL  0x1000    /* Read the file's owner/perms */
#define APR_WRITECONTROL 0x0800    /* Modifythe file's owner/perms */

I see a couple of problems here:

    * APR_READCONTROL and APR_WRITECONTROL are in conflict with
      APR_SENDFILE_ENABLED and APR_FILE_NOCLEANUP, which are defined in
      include/apr_file_io.h.
    * These two flags are never actually checked for in apr_file_open.
      Why are they defined at all?

I'd suggest moving the values of these internal flags into the
0x00100000--0x80000000 range, and adding a note to apr_file_io.h that
those values are reserved for internal flags. Note that the flags
parameter is an apr_int32_t, so that range is always available.

Right now, APR_READCONTROL can get passed to apr_file_open from
apr_stat, but is then interpreted as APR_SENDFILE_ENABLED ... weird, to
say the least.

Thoughts? If nobody objects, I'll make that change soonish. Somebody
should probably check the other platforms for similar overlap, 

-- 
Brane ─îibej   <brane@xbc.nu>   http://www.xbc.nu/brane/


Mime
View raw message