Fixed assert macros, and improved error handling.

This commit is contained in:
Бранимир Караџић
2021-10-25 18:59:11 -07:00
parent 11c3c5e615
commit 51c3264846
42 changed files with 226 additions and 154 deletions

View File

@@ -3,7 +3,6 @@
* License: https://github.com/bkaradzic/bx#license-bsd-2-clause
*/
#include "bx_p.h"
#include <bx/file.h>
#ifndef BX_CONFIG_CRT_FILE_READER_WRITER
@@ -923,7 +922,7 @@ namespace bx
Error err;
DirectoryReader dr;
if (!bx::open(&dr, _filePath) )
if (!open(&dr, _filePath, &err) )
{
BX_ERROR_SET(_err, kErrorNotDirectory, "File already exist, and is not directory.");
return false;
@@ -931,7 +930,7 @@ namespace bx
while (err.isOk() )
{
bx::read(&dr, fi, &err);
read(&dr, fi, &err);
if (err.isOk() )
{
@@ -951,7 +950,7 @@ namespace bx
}
}
bx::close(&dr);
close(&dr);
return remove(_filePath, _err);
}