mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
bug 463411 - nsinstall.exe can race creating directories. r=timeless
This commit is contained in:
parent
d3c79aa757
commit
ac6fe958a3
@ -150,15 +150,18 @@ shellMkdir (wchar_t **pArgv)
|
||||
|
||||
/* check if directory already exists */
|
||||
_wgetcwd ( path, _MAX_PATH );
|
||||
if ( _wchdir ( tmpPath ) != -1 ) {
|
||||
_wchdir ( path );
|
||||
if ( _wchdir ( tmpPath ) == -1 &&
|
||||
_wmkdir ( tmpPath ) == -1 && // might have hit EEXIST
|
||||
_wchdir ( tmpPath ) == -1) { // so try again
|
||||
char buf[2048];
|
||||
_snprintf(buf, 2048, "Could not create the directory: %S",
|
||||
tmpPath);
|
||||
perror ( buf );
|
||||
retVal = 3;
|
||||
break;
|
||||
} else {
|
||||
if ( _wmkdir ( tmpPath ) == -1 ) {
|
||||
printf ( "%ls: ", tmpPath );
|
||||
perror ( "Could not create the directory" );
|
||||
retVal = 3;
|
||||
break;
|
||||
}
|
||||
// get back to the cwd
|
||||
_wchdir ( path );
|
||||
}
|
||||
if ( *pArg == '\0' ) /* complete path? */
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user