bug fix, start receiver fail does not return

This commit is contained in:
maliakal_d 2018-10-10 11:24:17 +02:00
parent 9ca163dfc9
commit 4b166b726e
2 changed files with 5 additions and 3 deletions

View File

@ -227,8 +227,10 @@ void Listener::ShutDownUDPSocket() {
udpSocket->ShutDownSocket(); udpSocket->ShutDownSocket();
FILE_LOG(logINFO) << "Shut down of UDP port " << *udpPortNumber; FILE_LOG(logINFO) << "Shut down of UDP port " << *udpPortNumber;
fflush(stdout); fflush(stdout);
//delete socket at stoplistening // wait only if the threads have started as it is the threads that
sem_wait(&semaphore_socket); //give a post to semaphore(at stopListening)
if (runningFlag)
sem_wait(&semaphore_socket);
delete udpSocket; delete udpSocket;
udpSocket = 0; udpSocket = 0;
sem_destroy(&semaphore_socket); sem_destroy(&semaphore_socket);

View File

@ -1039,7 +1039,7 @@ int slsReceiverImplementation::startReceiver(char *c) {
//processor->writer //processor->writer
if (fileWriteEnable) { if (fileWriteEnable) {
if (SetupWriter() == FAIL) { if (SetupWriter() == FAIL) {
strcpy(c,"Could not create file."); strcpy(c,"Could not create file.\n");
FILE_LOG(logERROR) << c; FILE_LOG(logERROR) << c;
return FAIL; return FAIL;
} }