com php-src: set errno in ioutil access routine: win32/ioutil.h
| From: | Anatol Belski | Date: | Fri, 29 Jul 2016 12:31:06 +0000 |
| Subject: | com php-src: set errno in ioutil access routine: win32/ioutil.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93476@lists.php.net to get a copy of this message | ||
Commit: d8403aa019edbaef276124da4afa4f71127c568d
Author: Anatol Belski <ab@php.net> Fri, 29 Jul 2016 14:31:06 +0200
Parents: 6dbfd4287bfb4de8bc7446f3c09ccce4e75368b6
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d8403aa019edbaef276124da4afa4f71127c568d
Log:
set errno in ioutil access routine
Changed paths:
M win32/ioutil.h
Diff:
diff --git a/win32/ioutil.h b/win32/ioutil.h
index 2a02d52..ea40db4 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;
}/*}}}*/