mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Fix error condition
This commit is contained in:
parent
8827cc34cf
commit
ee9d879f57
@ -872,13 +872,13 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
|
|||||||
sz.HighPart = 0;
|
sz.HighPart = 0;
|
||||||
sz.LowPart = new_size;
|
sz.LowPart = new_size;
|
||||||
#endif
|
#endif
|
||||||
if (INVALID_SET_FILE_POINTER == SetFilePointerEx(h, sz, NULL, FILE_BEGIN) && NO_ERROR != GetLastError()) {
|
if (!SetFilePointerEx(h, sz, NULL, FILE_BEGIN)) {
|
||||||
return PHP_STREAM_OPTION_RETURN_ERR;
|
return PHP_STREAM_OPTION_RETURN_ERR;
|
||||||
}
|
}
|
||||||
if (0 == SetEndOfFile(h)) {
|
if (0 == SetEndOfFile(h)) {
|
||||||
return PHP_STREAM_OPTION_RETURN_ERR;
|
return PHP_STREAM_OPTION_RETURN_ERR;
|
||||||
}
|
}
|
||||||
if (INVALID_SET_FILE_POINTER == SetFilePointerEx(h, old_sz, NULL, FILE_BEGIN) && NO_ERROR != GetLastError()) {
|
if (!SetFilePointerEx(h, old_sz, NULL, FILE_BEGIN)) {
|
||||||
return PHP_STREAM_OPTION_RETURN_ERR;
|
return PHP_STREAM_OPTION_RETURN_ERR;
|
||||||
}
|
}
|
||||||
return PHP_STREAM_OPTION_RETURN_OK;
|
return PHP_STREAM_OPTION_RETURN_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user