esrf changes: eiver: initialise global optind variable before calling getopt_long: Needed when multiple receivers are instantiated in the same process

This commit is contained in:
maliakal_d 2018-04-23 17:43:54 +02:00
parent d09a1a0a95
commit e0bb7d74f4
2 changed files with 2 additions and 7 deletions

View File

@ -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;
};

View File

@ -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;