diff options
author | ivan <ivan@13f79535-47bb-0310-9956-ffa450edef68> | 2019-05-26 10:01:41 +0000 |
---|---|---|
committer | ivan <ivan@13f79535-47bb-0310-9956-ffa450edef68> | 2019-05-26 10:01:41 +0000 |
commit | 35509a61d2c83411ef3198e480a8eadb69e7adf1 (patch) | |
tree | cfe064bcd668a756e9ff57c859b4f8aa52edb756 /file_io | |
parent | a675e34724a99813a8185c9e7e992a6e3572b3b8 (diff) | |
download | libapr-35509a61d2c83411ef3198e480a8eadb69e7adf1.tar.gz |
win32: Remove ANSI codepath from apr_file_attrs_set().
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1860044 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/win32/filestat.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c index cb0a32595..e3869481e 100644 --- a/file_io/win32/filestat.c +++ b/file_io/win32/filestat.c @@ -795,32 +795,19 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, { DWORD flags; apr_status_t rv; -#if APR_HAS_UNICODE_FS apr_wchar_t wfname[APR_PATH_MAX]; -#endif /* Don't do anything if we can't handle the requested attributes */ if (!(attr_mask & (APR_FILE_ATTR_READONLY | APR_FILE_ATTR_HIDDEN))) return APR_SUCCESS; -#if APR_HAS_UNICODE_FS - IF_WIN_OS_IS_UNICODE - { - if ((rv = utf8_to_unicode_path(wfname, - sizeof(wfname) / sizeof(wfname[0]), - fname))) - return rv; - flags = GetFileAttributesW(wfname); - } -#endif -#if APR_HAS_ANSI_FS - ELSE_WIN_OS_IS_ANSI - { - flags = GetFileAttributesA(fname); - } -#endif + if ((rv = utf8_to_unicode_path(wfname, + sizeof(wfname) / sizeof(wfname[0]), + fname))) + return rv; + flags = GetFileAttributesW(wfname); if (flags == 0xFFFFFFFF) return apr_get_os_error(); @@ -840,18 +827,7 @@ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, flags &= ~FILE_ATTRIBUTE_HIDDEN; } -#if APR_HAS_UNICODE_FS - IF_WIN_OS_IS_UNICODE - { - rv = SetFileAttributesW(wfname, flags); - } -#endif -#if APR_HAS_ANSI_FS - ELSE_WIN_OS_IS_ANSI - { - rv = SetFileAttributesA(fname, flags); - } -#endif + rv = SetFileAttributesW(wfname, flags); if (rv == 0) return apr_get_os_error(); |