Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
most linuxes seem to prefer resetting this value at 0 to initiate some cleanups
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 6 Apr 2019 10:40:12 +0000 (12:40 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 6 Apr 2019 10:40:12 +0000 (12:40 +0200)
from the manpage :
(Resetting  to 0 forces the invocation of an internal initialization routine that rechecks POSIXLY_CORRECT and
       checks for GNU extensions in optstring.)

src/smpi/include/smpi_actor.hpp
src/smpi/internals/smpi_actor.cpp

index 97d4d2b..0986429 100644 (file)
@@ -31,7 +31,11 @@ class ActorExt {
   smpi_trace_call_location_t trace_call_loc_;
   s4u::ActorPtr actor_                           = nullptr;
   smpi_privatization_region_t privatized_region_ = nullptr;
-  int optind                                     = 1; /*for getopt replacement */
+#ifdef __linux__
+  int optind_                                     = 0; /*for getopt replacement */
+#else
+  int optind_                                     = 1; /*for getopt replacement */
+#endif
   std::string tracing_category_                  = "";
 
 #if HAVE_PAPI
index e657ab9..0a9a96d 100644 (file)
@@ -246,11 +246,11 @@ void ActorExt::init()
 
 int ActorExt::get_optind()
 {
-  return optind;
+  return optind_;
 }
 void ActorExt::set_optind(int new_optind)
 {
-  optind = new_optind;
+  optind_ = new_optind;
 }
 
 } // namespace smpi