On Monday, 4 November 2019 09:29:41 PST Edward Welbourne wrote:
> On Monday, 4 November 2019 01:40:00 PST Edward Welbourne wrote:
> > I want to do qputenv in the Qt application *itself*, inside
> > QCoreApplication. Note the most important process that this will apply
> > to: itself. It applies to all other frameworks inside the same
> > application that may inspect the environment, including an extra unknown
> > call to setlocale(LC_ALL, "").

> ... and we can do that just fine if we
> * record the prior value we're over-riding on some master object,
>   that also remembers the list of regexes;
> * call qputenv() exactly as you have in mind;
> * when about to start a sub-process, ask that master object if the
>   command name matches one of its regexes;
> * if it does, restore *for only it* (e.g. after fork()) the prior value.

That only applies to QProcess. It will not apply to third-party components 
that fork helper processes.

It's possible atfork() could do this, but I'm not sure. it won't catch all of 
them, especially those that prepare the environment before forking (like 
execve / execle's caller).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to