зеркало из https://github.com/mozilla/gecko-dev.git
bug 463411 - nsinstall.exe can race creating directories. r=timeless
This commit is contained in:
Родитель
d3c79aa757
Коммит
ac6fe958a3
|
@ -150,15 +150,18 @@ shellMkdir (wchar_t **pArgv)
|
||||||
|
|
||||||
/* check if directory already exists */
|
/* check if directory already exists */
|
||||||
_wgetcwd ( path, _MAX_PATH );
|
_wgetcwd ( path, _MAX_PATH );
|
||||||
if ( _wchdir ( tmpPath ) != -1 ) {
|
if ( _wchdir ( tmpPath ) == -1 &&
|
||||||
_wchdir ( path );
|
_wmkdir ( tmpPath ) == -1 && // might have hit EEXIST
|
||||||
} else {
|
_wchdir ( tmpPath ) == -1) { // so try again
|
||||||
if ( _wmkdir ( tmpPath ) == -1 ) {
|
char buf[2048];
|
||||||
printf ( "%ls: ", tmpPath );
|
_snprintf(buf, 2048, "Could not create the directory: %S",
|
||||||
perror ( "Could not create the directory" );
|
tmpPath);
|
||||||
|
perror ( buf );
|
||||||
retVal = 3;
|
retVal = 3;
|
||||||
break;
|
break;
|
||||||
}
|
} else {
|
||||||
|
// get back to the cwd
|
||||||
|
_wchdir ( path );
|
||||||
}
|
}
|
||||||
if ( *pArg == '\0' ) /* complete path? */
|
if ( *pArg == '\0' ) /* complete path? */
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче