HomeClusterLabs Projects

Fix: libcrmcommon: Call g_set_prgname early if possible.

Description

Fix: libcrmcommon: Call g_set_prgname early if possible.

In crm_mon, the call to pcmkforce_args happens fairly early. The
parameters to this function include a call to g_get_prgname. Normally
this would be okay because glib will call g_set_prgname for us from one
of the g_option_context_parse*. However, that call happens as a part of
pcmk
force_args which means there's no program name set yet, resulting
in "(null)" in help output.

Instead, call g_set_prgname from inside pcmk__cmdline_preproc. This
should be just about the earliest of the command line handling functions
that ever gets called.

Details

Provenance
clumensAuthored on Apr 22 2020, 1:40 PM
Parents
rPa490a719dd84: Merge pull request #2039 from clumens/more-misc
Branches
Unknown
Tags
Unknown

Event Timeline