Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liboptparse: make optparse_parse_args() reentrant #908

merged 6 commits into from Nov 18, 2016


None yet
4 participants
Copy link

grondo commented Nov 17, 2016

This is an alternate approach to #906, which instead of adding NLS support to flux-core, makes another small change to GNU getopt.c and adds

#define _(msgid) msgid

Which effectively works around the requirement for gettext().

I should probably devise a way to test the MT-safety of the optparse_parse_args() version that uses getopt_internal_r

grondo added some commits Nov 16, 2016

liboptparse: add glibc getopt sources
Add glibc getopt source from v2.24.90. Add getopt_int.h header file
for access to _getopt_internal_r function, the reentrant version of
liboptparse: avoid elision of code in GNU getopt.c
Force code to *not* be elided in included GNU getopt.c. We want to
use the internal, thread safe function, and therefore do not care
if the getopt interface version matches the glibc we're compiling
liboptparse: use getopt_internal_r
Use the included internal, thread safe version of GNU getopt.
liboptparse: link with internal GNU getopt
Include a copy of GNU getopt sources directly in liboptparse, so
that we can eventually use getopt_internal_r instead of non-reentrant
public getopt(3).
liboptparse: disable gettext in GNU getopt.c
Avoid use of gettext() in GNU getopt.c by commenting out
libintl.h/gettext.h #include, and instead add

 #define _(msgid) msgid

@grondo grondo added the review label Nov 17, 2016


This comment has been minimized.

Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage increased (+0.01%) to 75.966% when pulling 2370a56 on grondo:optparse-reentrant2 into 55dcaaf on flux-framework:master.


This comment has been minimized.

Copy link

codecov-io commented Nov 17, 2016

Current coverage is 72.36% (diff: 90.00%)

Merging #908 into master will increase coverage by <.01%

@@             master       #908   diff @@
  Files           157        157          
  Lines         27043      27042     -1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
+ Hits          19567      19568     +1   
+ Misses         7476       7474     -2   
  Partials          0          0          
Diff Coverage File Path
••••••••• 90% src/common/liboptparse/optparse.c

Powered by Codecov. Last update 55dcaaf...2370a56


This comment has been minimized.

Copy link

garlick commented Nov 18, 2016

Still working on this one? I'm good with it as is...


This comment has been minimized.

Copy link
Contributor Author

grondo commented Nov 18, 2016

I think this one is ready.

@garlick garlick merged commit a2de3c4 into flux-framework:master Nov 18, 2016

4 checks passed

codecov/patch 90.00% of diff hit (target 72.35%)
codecov/project 72.36% (+<.01%) compared to 55dcaaf
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage increased (+0.01%) to 75.966%

@garlick garlick removed the review label Nov 18, 2016

@grondo grondo deleted the grondo:optparse-reentrant2 branch Nov 19, 2016

@grondo grondo referenced this pull request Nov 28, 2016


Create 0.6.0 release notes #916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.