mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 463411 - nsinstall.exe can race creating directories. r=timeless (sync js/src copy of nsinstall_win.c)
This commit is contained in:
parent
0a80083f29
commit
96ab3547a7
@ -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…
Reference in New Issue
Block a user