proper EEXIST error for mkdir
This commit is contained in:
parent
0b40e7aa2f
commit
3df00537cd
@ -887,7 +887,7 @@ sdmc_mkdir(struct _reent *r,
|
|||||||
const char *path,
|
const char *path,
|
||||||
int mode)
|
int mode)
|
||||||
{
|
{
|
||||||
Result rc;
|
Result rc;
|
||||||
FS_Path fs_path;
|
FS_Path fs_path;
|
||||||
|
|
||||||
fs_path = sdmc_utf16path(r, path);
|
fs_path = sdmc_utf16path(r, path);
|
||||||
@ -897,7 +897,12 @@ sdmc_mkdir(struct _reent *r,
|
|||||||
/* TODO: Use mode to set directory attributes. */
|
/* TODO: Use mode to set directory attributes. */
|
||||||
|
|
||||||
rc = FSUSER_CreateDirectory(sdmcArchive, fs_path, 0);
|
rc = FSUSER_CreateDirectory(sdmcArchive, fs_path, 0);
|
||||||
if(R_SUCCEEDED(rc))
|
if(rc == 0xC82044BE)
|
||||||
|
{
|
||||||
|
r->_errno = EEXIST;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else if(R_SUCCEEDED(rc))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
r->_errno = sdmc_translate_error(rc);
|
r->_errno = sdmc_translate_error(rc);
|
||||||
|
Loading…
Reference in New Issue
Block a user