mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026781: Coding rules - eliminate GCC warning -Wunused-result
Check return code of fgets() and system() within FSD_BinaryFile::ReadChar(), IFSelect_SessionFile::ReadFile(), IFSelect_SessionPilot::ReadScript(), OSD_File::Print(), OSD_Process::Spawn(), RWStl::ReadAscii(), iges_lire().
This commit is contained in:
@@ -750,7 +750,8 @@ TCollection_AsciiString PrinterName;
|
||||
else
|
||||
sprintf(buffer,"lpr -P%s %s",PrinterName.ToCString(),aBuffer.ToCString());
|
||||
|
||||
system(buffer);
|
||||
if (system(buffer) != 0)
|
||||
Standard_ProgramError::Raise("OSD_File::Print : No output device was available, or an error occurred");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -36,10 +36,10 @@ OSD_Process::OSD_Process(){
|
||||
}
|
||||
|
||||
|
||||
void OSD_Process::Spawn (const TCollection_AsciiString& cmd,
|
||||
Standard_Integer OSD_Process::Spawn (const TCollection_AsciiString& cmd,
|
||||
const Standard_Boolean /*ShowWindow*/)
|
||||
{
|
||||
system(cmd.ToCString());
|
||||
return system(cmd.ToCString());
|
||||
}
|
||||
|
||||
|
||||
@@ -206,11 +206,13 @@ OSD_Process :: OSD_Process () {
|
||||
|
||||
} // end constructor
|
||||
|
||||
void OSD_Process :: Spawn ( const TCollection_AsciiString& cmd ,
|
||||
|
||||
Standard_Integer OSD_Process::Spawn (const TCollection_AsciiString& cmd,
|
||||
const Standard_Boolean ShowWindow /* = Standard_True */) {
|
||||
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD aRes = 0;
|
||||
|
||||
ZeroMemory ( &si, sizeof ( STARTUPINFO ) );
|
||||
|
||||
@@ -229,20 +231,22 @@ void OSD_Process :: Spawn ( const TCollection_AsciiString& cmd ,
|
||||
if (!CreateProcess (
|
||||
NULL, (char *)cmd.ToCString (), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi
|
||||
)
|
||||
)
|
||||
) {
|
||||
|
||||
_osd_wnt_set_error ( myError, OSD_WProcess );
|
||||
|
||||
aRes = myError.Error();
|
||||
}
|
||||
else {
|
||||
|
||||
CloseHandle ( pi.hThread );
|
||||
|
||||
WaitForSingleObject ( pi.hProcess, INFINITE );
|
||||
|
||||
GetExitCodeProcess (pi.hProcess, &aRes);
|
||||
CloseHandle ( pi.hProcess );
|
||||
|
||||
} // end else
|
||||
|
||||
return aRes;
|
||||
} // end OSD_Process :: Spawn
|
||||
|
||||
void OSD_Process :: TerminalType ( TCollection_AsciiString& Name ) {
|
||||
|
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
//! Issues a shell command
|
||||
//! ShowWindow : flag to allow show/hide of the window ( only used on WNT )
|
||||
Standard_EXPORT void Spawn (const TCollection_AsciiString& cmd, const Standard_Boolean ShowWindow = Standard_True);
|
||||
Standard_EXPORT Standard_Integer Spawn (const TCollection_AsciiString& cmd, const Standard_Boolean ShowWindow = Standard_True);
|
||||
|
||||
//! Returns the terminal used (vt100, vt200 ,sun-cmd ...)
|
||||
Standard_EXPORT void TerminalType (TCollection_AsciiString& Name);
|
||||
|
Reference in New Issue
Block a user