@@ -340,7 +340,6 @@ PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode)
340
340
341
341
PW32IO int php_win32_ioutil_unlink_w (const wchar_t * path )
342
342
{/*{{{*/
343
- int ret = 0 ;
344
343
DWORD err = 0 ;
345
344
HANDLE h ;
346
345
BY_HANDLE_FILE_INFORMATION info ;
@@ -413,12 +412,11 @@ PW32IO int php_win32_ioutil_unlink_w(const wchar_t *path)
413
412
PW32IO int php_win32_ioutil_rmdir_w (const wchar_t * path )
414
413
{/*{{{*/
415
414
int ret = 0 ;
416
- DWORD err = 0 ;
417
415
418
416
PHP_WIN32_IOUTIL_CHECK_PATH_W (path , -1 , 0 )
419
417
420
418
if (!RemoveDirectoryW (path )) {
421
- err = GetLastError ();
419
+ DWORD err = GetLastError ();
422
420
ret = -1 ;
423
421
SET_ERRNO_FROM_WIN32_CODE (err );
424
422
}
@@ -429,10 +427,9 @@ PW32IO int php_win32_ioutil_rmdir_w(const wchar_t *path)
429
427
PW32IO int php_win32_ioutil_chdir_w (const wchar_t * path )
430
428
{/*{{{*/
431
429
int ret = 0 ;
432
- DWORD err = 0 ;
433
430
434
431
if (!SetCurrentDirectoryW (path )) {
435
- err = GetLastError ();
432
+ DWORD err = GetLastError ();
436
433
ret = -1 ;
437
434
SET_ERRNO_FROM_WIN32_CODE (err );
438
435
}
@@ -443,14 +440,13 @@ PW32IO int php_win32_ioutil_chdir_w(const wchar_t *path)
443
440
PW32IO int php_win32_ioutil_rename_w (const wchar_t * oldname , const wchar_t * newname )
444
441
{/*{{{*/
445
442
int ret = 0 ;
446
- DWORD err = 0 ;
447
443
448
444
PHP_WIN32_IOUTIL_CHECK_PATH_W (oldname , -1 , 0 )
449
445
PHP_WIN32_IOUTIL_CHECK_PATH_W (newname , -1 , 0 )
450
446
451
447
452
448
if (!MoveFileExW (oldname , newname , MOVEFILE_REPLACE_EXISTING |MOVEFILE_COPY_ALLOWED )) {
453
- err = GetLastError ();
449
+ DWORD err = GetLastError ();
454
450
ret = -1 ;
455
451
SET_ERRNO_FROM_WIN32_CODE (err );
456
452
}
@@ -640,7 +636,7 @@ BOOL php_win32_ioutil_init(void)
640
636
641
637
PW32IO int php_win32_ioutil_access_w (const wchar_t * path , mode_t mode )
642
638
{/*{{{*/
643
- DWORD attr , err ;
639
+ DWORD attr ;
644
640
645
641
if ((mode & X_OK ) == X_OK ) {
646
642
DWORD type ;
@@ -649,7 +645,7 @@ PW32IO int php_win32_ioutil_access_w(const wchar_t *path, mode_t mode)
649
645
650
646
attr = GetFileAttributesW (path );
651
647
if (attr == INVALID_FILE_ATTRIBUTES ) {
652
- err = GetLastError ();
648
+ DWORD err = GetLastError ();
653
649
SET_ERRNO_FROM_WIN32_CODE (err );
654
650
return -1 ;
655
651
}
0 commit comments