mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Merge branch 'PHP-7.1'
* PHP-7.1: improve error handling
This commit is contained in:
commit
4bdd63595b
1 changed files with 18 additions and 6 deletions
|
@ -246,7 +246,9 @@ __forceinline static int php_win32_ioutil_access(const char *path, mode_t mode)
|
||||||
PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, -1, 1)
|
PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, -1, 1)
|
||||||
|
|
||||||
ret = _waccess(pathw, mode);
|
ret = _waccess(pathw, mode);
|
||||||
|
if (0 > ret) {
|
||||||
_get_errno(&err);
|
_get_errno(&err);
|
||||||
|
}
|
||||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||||
|
|
||||||
if (0 > ret) {
|
if (0 > ret) {
|
||||||
|
@ -279,7 +281,9 @@ __forceinline static int php_win32_ioutil_open(const char *path, int flags, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = php_win32_ioutil_open_w(pathw, flags, mode);
|
ret = php_win32_ioutil_open_w(pathw, flags, mode);
|
||||||
|
if (0 > ret) {
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
|
}
|
||||||
PHP_WIN32_IOUTIL_CLEANUP_W()
|
PHP_WIN32_IOUTIL_CLEANUP_W()
|
||||||
|
|
||||||
if (0 > ret) {
|
if (0 > ret) {
|
||||||
|
@ -368,7 +372,9 @@ __forceinline static FILE *php_win32_ioutil_fopen(const char *patha, const char
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = _wfopen(pathw, modew);
|
ret = _wfopen(pathw, modew);
|
||||||
|
if (!ret) {
|
||||||
_get_errno(&err);
|
_get_errno(&err);
|
||||||
|
}
|
||||||
free(pathw);
|
free(pathw);
|
||||||
free(modew);
|
free(modew);
|
||||||
|
|
||||||
|
@ -405,7 +411,9 @@ __forceinline static int php_win32_ioutil_rename(const char *oldnamea, const cha
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = php_win32_ioutil_rename_w(oldnamew, newnamew);
|
ret = php_win32_ioutil_rename_w(oldnamew, newnamew);
|
||||||
|
if (0 > ret) {
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
free(oldnamew);
|
free(oldnamew);
|
||||||
free(newnamew);
|
free(newnamew);
|
||||||
|
@ -429,7 +437,9 @@ __forceinline static int php_win32_ioutil_chdir(const char *patha)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = php_win32_ioutil_chdir_w(pathw);
|
ret = php_win32_ioutil_chdir_w(pathw);
|
||||||
|
if (0 > ret) {
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
free(pathw);
|
free(pathw);
|
||||||
|
|
||||||
|
@ -495,7 +505,9 @@ __forceinline static int php_win32_ioutil_chmod(const char *patha, int mode)
|
||||||
PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, -1, 1)
|
PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, -1, 1)
|
||||||
|
|
||||||
ret = _wchmod(pathw, mode);
|
ret = _wchmod(pathw, mode);
|
||||||
|
if (0 > ret) {
|
||||||
_get_errno(&err);
|
_get_errno(&err);
|
||||||
|
}
|
||||||
|
|
||||||
free(pathw);
|
free(pathw);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue