<br><br><div class="gmail_quote">On Fri, May 27, 2011 at 2:20 PM, Stuart D. Gathman <span dir="ltr"><<a href="mailto:stuart@bmsi.com">stuart@bmsi.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 27 May 2011, Keven L. Ates wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A problem I see with the above code is that the env checking function<br>
appears to be called every time a variable is needed (see statepath calls). This practice should probable be changed so that the env variable is loaded<br>
once at program startup and stored in a global var/struct and then used as<br>
needed.  This is so that changes to a env var within the programs runtime<br>
context does not modify behavior or cause error, such as changing where it<br>
looks for the PID file AFTER the PID file was created.<br>
</blockquote>
<br></div>
Under unix, at least, environment vars are copied to a process when it is<br>
created, and can only be changed by the process itself.  So getenv()<br>
in effect *is* the global var/struct you want.  Is Windows different<br>
in that regard?<br><font color="#888888">
<br>
--<br>
              Stuart D. Gathman <<a href="mailto:stuart@bmsi.com" target="_blank">stuart@bmsi.com</a>><br>
    Business Management Systems Inc.  Phone: <a href="tel:703%20591-0911" value="+17035910911" target="_blank">703 591-0911</a> Fax: <a href="tel:703%20591-6154" value="+17035916154" target="_blank">703 591-6154</a><br>
"Confutatis maledictis, flammis acribus addictis" - background song for<br>
a Microsoft sponsored "Where do you want to go from here?" commercial.<br>
</font></blockquote></div><br>That is generally the case, but then again people wish to do some odd things:<br><a href="http://stackoverflow.com/questions/205064/is-there-a-way-to-change-another-processs-environment-variables" target="_blank">http://stackoverflow.com/questions/205064/is-there-a-way-to-change-another-processs-environment-variables</a><br>
<font color="#888888">
<br>Keven</font>