From ba904b047b1aabfbcca3621e1db02511eb9c63d3 Mon Sep 17 00:00:00 2001 From: smh Date: Fri, 14 May 2004 12:30:05 +0000 Subject: [PATCH] PAL5847: comparing return value of system() function with -1 is very unreliable, for any non-zero value can be returned as error code. --- src/VISU_I/VISU_Gen_i.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 665fb4d5..33527f6d 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -231,11 +231,14 @@ namespace VISU{ QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str(); static QString aCommand; aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1()); - if(system(aCommand) == -1){ + + int aRes = system(aCommand); + if(aRes){ if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<GetName()).c_str(); static QString aCommand; aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1()); - - if(system(aCommand) == -1){ - if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<