diff options
author | Anatol Belski <ab@php.net> | 2016-07-29 14:31:06 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-07-29 14:31:06 +0200 |
commit | d8403aa019edbaef276124da4afa4f71127c568d (patch) | |
tree | a3a323e409aff689aa8c0a2aa21c2903129fe2ac /win32 | |
parent | 6dbfd4287bfb4de8bc7446f3c09ccce4e75368b6 (diff) | |
download | php-git-d8403aa019edbaef276124da4afa4f71127c568d.tar.gz |
set errno in ioutil access routine
Diffstat (limited to 'win32')
-rw-r--r-- | win32/ioutil.h | 8 |
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; }/*}}}*/ |