summaryrefslogtreecommitdiff
path: root/win32/ioutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32/ioutil.h')
-rw-r--r--win32/ioutil.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/ioutil.h b/win32/ioutil.h
index 2a02d52c51..ea40db4c66 100644
--- a/win32/ioutil.h
+++ b/win32/ioutil.h
@@ -230,7 +230,7 @@ PW32IO int php_win32_ioutil_access_w(const wchar_t *path, mode_t mode);
__forceinline static int php_win32_ioutil_access(const char *path, mode_t mode)
{/*{{{*/
PHP_WIN32_IOUTIL_INIT_W(path)
- int ret;
+ int ret, err;
if (!pathw) {
SET_ERRNO_FROM_WIN32_CODE(ERROR_INVALID_PARAMETER);
@@ -239,10 +239,14 @@ __forceinline static int php_win32_ioutil_access(const char *path, mode_t mode)
PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, -1)
- /* TODO set errno. */
ret = _waccess(pathw, mode);
+ _get_errno(&err);
PHP_WIN32_IOUTIL_CLEANUP_W()
+ if (0 > ret) {
+ _set_errno(err);
+ }
+
return ret;
}/*}}}*/