summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Zhakov <ivan@apache.org>2019-05-26 10:01:41 +0000
committerIvan Zhakov <ivan@apache.org>2019-05-26 10:01:41 +0000
commit97259b66759289997d790c1aab5daa117fa98aa7 (patch)
treecfe064bcd668a756e9ff57c859b4f8aa52edb756
parente13955708b60fd133178d56c545b722bc3a377df (diff)
downloadapr-97259b66759289997d790c1aab5daa117fa98aa7.tar.gz
win32: Remove ANSI codepath from apr_file_attrs_set().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860044 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/win32/filestat.c36
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();