From 8c06405622d7177076b9795cd4fe368f58e9eeaf Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Tue, 19 Mar 2013 16:00:25 +0000 Subject: [PATCH] reduced gui_client crashes git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@498 951219d9-93cf-4727-9268-0efd64621fa3 --- .../multiSlsDetector/multiSlsDetector.cpp | 2 +- slsDetectorSoftware/slsDetector/slsDetector.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 4519e0047..4d84da743 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -3493,7 +3493,7 @@ int multiSlsDetector::setNumberOfModules(int p, dimension d) { thisMultiDetector->dataBytes+=detectors[idet]->getDataBytes(); thisMultiDetector->numberOfChannels+=detectors[idet]->getTotalNumberOfChannels(); } - } + } return ret; } diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index a298e0b25..c5bb4cccf 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -1332,12 +1332,12 @@ slsDetectorDefs::detectorType slsDetector::getDetectorsType(int pos){ // if n=GET_FLAG returns the number of installed modules, int slsDetector::setNumberOfModules(int n, dimension d){ - int arg[2], retval; + int arg[2], retval=1; int fnum=F_SET_NUMBER_OF_MODULES; int ret=FAIL; - char mess[100]; + char mess[100]="dummy"; int connect; - + int num; arg[0]=d; arg[1]=n; @@ -1358,11 +1358,11 @@ int slsDetector::setNumberOfModules(int n, dimension d){ if (connect == UNDEFINED) cout << "no control socket?" << endl; else if (connect == OK){ - controlSocket->SendDataOnly(&fnum,sizeof(fnum)); - controlSocket->SendDataOnly(&arg,sizeof(arg)); - controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + num = controlSocket->SendDataOnly(&fnum,sizeof(fnum)); + num = controlSocket->SendDataOnly(&arg,sizeof(arg)); + num = controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); if (ret!=FAIL) { - controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + num = controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); } else { controlSocket->ReceiveDataOnly(mess,sizeof(mess)); std::cout<< "Detector returned error: " << mess << std::endl;