From e0bb7d74f404fc86a755adcc61c7a1334eb01c92 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 23 Apr 2018 17:43:54 +0200 Subject: [PATCH] esrf changes: eiver: initialise global optind variable before calling getopt_long: Needed when multiple receivers are instantiated in the same process --- slsReceiverSoftware/include/circularFifo.h | 6 ------ slsReceiverSoftware/src/slsReceiver.cpp | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/slsReceiverSoftware/include/circularFifo.h b/slsReceiverSoftware/include/circularFifo.h index 580e11654..6a6b39b35 100644 --- a/slsReceiverSoftware/include/circularFifo.h +++ b/slsReceiverSoftware/include/circularFifo.h @@ -50,14 +50,8 @@ private: unsigned int tail; // input index unsigned int head; // output index unsigned int Capacity; -//#ifdef __cplusplus >= 201103L mutable sem_t data_mutex; mutable sem_t free_mutex; -//#else -// sem_t free_mutex; - -//#endif - unsigned int increment(unsigned int idx_) const; }; diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index 838554bb3..b8d74afa1 100644 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -42,7 +42,8 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success): {0, 0, 0, 0} }; - + //initialize global optind variable (required when instantiating multiple receivers in the same process) + optind = 1; // getopt_long stores the option index here. int option_index = 0; int c = 0;