pcsx2: check return value of std functions

Avoid noisy gcc warnings
This commit is contained in:
Gregory Hainaut 2016-11-12 17:36:06 +01:00
parent 1053234507
commit 63c825d0e0
3 changed files with 14 additions and 4 deletions

View File

@ -252,10 +252,13 @@ void iDumpBlock(u32 ee_pc, u32 ee_size, uptr x86_pc, u32 x86_size)
objdump.Write(x86, x86_size); objdump.Write(x86, x86_size);
objdump.Close(); objdump.Close();
std::system( int status = std::system(
wxsFormat( L"objdump -D -b binary -mi386 --disassembler-options=intel --no-show-raw-insn --adjust-vma=%d %s >> %s", wxsFormat( L"objdump -D -b binary -mi386 --disassembler-options=intel --no-show-raw-insn --adjust-vma=%d %s >> %s",
(u32) x86_pc, WX_STR(obj_filename), WX_STR(dump_filename)).mb_str() (u32) x86_pc, WX_STR(obj_filename), WX_STR(dump_filename)).mb_str()
); );
if (!WIFEXITED(status))
Console.Error("IOP dump didn't terminate normally");
#endif #endif
} }

View File

@ -58,11 +58,15 @@ void Hle_SetElfPath(const char* elfFileName)
Console.WriteLn("HLE Notice: ELF does not have a path.\n"); Console.WriteLn("HLE Notice: ELF does not have a path.\n");
// use %CD%/host/ // use %CD%/host/
getcwd(HostRoot,1000); // save the other 23 chars to append /host/ :P char* cwd = getcwd(HostRoot,1000); // save the other 23 chars to append /host/ :P
HostRoot[1000]=0; // Be Safe. HostRoot[1000]=0; // Be Safe.
if (cwd == nullptr) {
Console.Error("Hle_SetElfPath: getcwd: buffer is too small");
return;
}
char* last = HostRoot + strlen(HostRoot) - 1; char* last = HostRoot + strlen(HostRoot) - 1;
if((*last!='/') && (*last!='\\')) // PathAppend()-ish if((*last!='/') && (*last!='\\')) // PathAppend()-ish
last++; last++;

View File

@ -279,8 +279,11 @@ static void iIopDumpBlock( int startpc, u8 * ptr )
f2.Write( ptr, (uptr)x86Ptr - (uptr)ptr ); f2.Write( ptr, (uptr)x86Ptr - (uptr)ptr );
} }
std::system( wxsFormat( L"objdump -D -b binary -mi386 -M intel --no-show-raw-insn %s >> %s; rm %s", int status = std::system( wxsFormat( L"objdump -D -b binary -mi386 -M intel --no-show-raw-insn %s >> %s; rm %s",
"mydump1", WX_STR(filename), "mydump1").mb_str() ); "mydump1", WX_STR(filename), "mydump1").mb_str() );
if (!WIFEXITED(status))
Console.Error("IOP dump didn't terminate normally");
#endif #endif
} }