Merge branch 'arukibree-master' closes #4

This commit is contained in:
Phillip Stephens 2018-07-06 16:01:54 -07:00
commit 1ad101897c
2 changed files with 9 additions and 9 deletions

View File

@ -261,7 +261,7 @@ public:
if (Stat(apploaderIn.c_str(), &apploaderStat)) if (Stat(apploaderIn.c_str(), &apploaderStat))
{ {
LogModule.report(logvisor::Error, _S("unable to stat %s"), apploaderIn.c_str()); LogModule.report(logvisor::Error, _S("unable to stat %s"), apploaderIn.c_str());
return -1; return false;
} }
/* Check Boot */ /* Check Boot */
@ -270,7 +270,7 @@ public:
if (Stat(bootIn.c_str(), &bootStat)) if (Stat(bootIn.c_str(), &bootStat))
{ {
LogModule.report(logvisor::Error, _S("unable to stat %s"), bootIn.c_str()); LogModule.report(logvisor::Error, _S("unable to stat %s"), bootIn.c_str());
return -1; return false;
} }
/* Check BI2 */ /* Check BI2 */
@ -279,7 +279,7 @@ public:
if (Stat(bi2In.c_str(), &bi2Stat)) if (Stat(bi2In.c_str(), &bi2Stat))
{ {
LogModule.report(logvisor::Error, _S("unable to stat %s"), bi2In.c_str()); LogModule.report(logvisor::Error, _S("unable to stat %s"), bi2In.c_str());
return -1; return false;
} }
return _build( return _build(

View File

@ -17,7 +17,7 @@ public:
bool exists() bool exists()
{ {
FILE* fp = fopen(m_path.c_str(), "rb"); FILE* fp = Fopen(m_path.c_str(), _S("rb"));
if (!fp) if (!fp)
return false; return false;
fclose(fp); fclose(fp);
@ -26,7 +26,7 @@ public:
uint64_t size() uint64_t size()
{ {
FILE* fp = fopen(m_path.c_str(), "rb"); FILE* fp = Fopen(m_path.c_str(), _S("rb"));
if (!fp) if (!fp)
return 0; return 0;
FSeek(fp, 0, SEEK_END); FSeek(fp, 0, SEEK_END);
@ -42,7 +42,7 @@ public:
WriteStream(SystemStringView path, int64_t maxWriteSize, bool& err) WriteStream(SystemStringView path, int64_t maxWriteSize, bool& err)
: m_maxWriteSize(maxWriteSize) : m_maxWriteSize(maxWriteSize)
{ {
fp = fopen(path.data(), "wb"); fp = Fopen(path.data(), _S("wb"));
if (!fp) if (!fp)
{ {
LogModule.report(logvisor::Error, _S("unable to open '%s' for writing"), path.data()); LogModule.report(logvisor::Error, _S("unable to open '%s' for writing"), path.data());
@ -52,11 +52,11 @@ public:
WriteStream(SystemStringView path, uint64_t offset, int64_t maxWriteSize, bool& err) WriteStream(SystemStringView path, uint64_t offset, int64_t maxWriteSize, bool& err)
: m_maxWriteSize(maxWriteSize) : m_maxWriteSize(maxWriteSize)
{ {
fp = fopen(path.data(), "ab"); fp = Fopen(path.data(), _S("ab"));
if (!fp) if (!fp)
goto FailLoc; goto FailLoc;
fclose(fp); fclose(fp);
fp = fopen(path.data(), "r+b"); fp = Fopen(path.data(), _S("r+b"));
if (!fp) if (!fp)
goto FailLoc; goto FailLoc;
FSeek(fp, offset, SEEK_SET); FSeek(fp, offset, SEEK_SET);
@ -104,7 +104,7 @@ public:
FILE* fp; FILE* fp;
ReadStream(SystemStringView path, bool& err) ReadStream(SystemStringView path, bool& err)
{ {
fp = fopen(path.data(), "rb"); fp = Fopen(path.data(), _S("rb"));
if (!fp) if (!fp)
{ {
err = true; err = true;