diff --git a/Makefile b/Makefile index 5d24f6a..545d962 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,6 @@ clean: $(dir_out): @mkdir -p "$(dir_out)/luma/payloads" - @mkdir -p "$(dir_out)/luma/dumps/arm9" - @mkdir -p "$(dir_out)/luma/dumps/arm11" $(dir_out)/$(name).dat: $(dir_build)/main.bin $(dir_out) @$(MAKE) $(FLAGS) -C $(dir_mset) launcher diff --git a/source/exceptions.c b/source/exceptions.c index 847ae6d..61191d4 100644 --- a/source/exceptions.c +++ b/source/exceptions.c @@ -141,7 +141,11 @@ void detectAndProcessExceptionDumps(void) findDumpFile(path9, fileName); path9[16] = '/'; memcpy(&path9[17], fileName, sizeof(fileName)); - fileWrite((void *)dump, path9, size); + if(!fileWrite((void *)dump, path9, size)) + { + createDirectory("/luma/dumps/arm9"); + fileWrite((void *)dump, path9, size); + } } else @@ -149,7 +153,11 @@ void detectAndProcessExceptionDumps(void) findDumpFile(path11, fileName); path11[17] = '/'; memcpy(&path11[18], fileName, sizeof(fileName)); - fileWrite((void *)dump, path11, size); + if(!fileWrite((void *)dump, path11, size)) + { + createDirectory("/luma/dumps/arm11"); + fileWrite((void *)dump, path11, size); + } } char arm11Str[] = "Processor: ARM11 (core X)";