From 3df00537cd68cd3e10cfab6f6cb83a8aecb42dd3 Mon Sep 17 00:00:00 2001 From: Michael Theall Date: Sat, 16 Jan 2016 16:32:21 -0600 Subject: [PATCH] proper EEXIST error for mkdir --- libctru/source/sdmc_dev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libctru/source/sdmc_dev.c b/libctru/source/sdmc_dev.c index e8bf875..32ef701 100644 --- a/libctru/source/sdmc_dev.c +++ b/libctru/source/sdmc_dev.c @@ -887,7 +887,7 @@ sdmc_mkdir(struct _reent *r, const char *path, int mode) { - Result rc; + Result rc; FS_Path fs_path; fs_path = sdmc_utf16path(r, path); @@ -897,7 +897,12 @@ sdmc_mkdir(struct _reent *r, /* TODO: Use mode to set directory attributes. */ 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; r->_errno = sdmc_translate_error(rc);