mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: check return value of std functions
Avoid noisy gcc warnings
This commit is contained in:
parent
1053234507
commit
63c825d0e0
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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++;
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue