Boost logo

Boost :

From: Martin Wille (mw8329_at_[hidden])
Date: 2005-04-26 02:02:38


Caleb Epstein wrote:
> http://tinyurl.com/72sj8
>
> This test is failing on numerous platforms, some for the fact that
> "putenv" takes a non-const char* (Linux, Solaris, perhaps others).
>
> Attached is a patch for environment.ipp which changes it to use the
> setenv function on non-Windows systems. I believe this is a POSIX
> standard function (via BSD).
>
> I think this cleans up the code a bit, removing the raising of
> getenv/putenv into namespace std, when they are I think clearly
> non-std functions.

setenv() is a very recent addition to POSIX, IIRC. Older Unix versions
might not support it.

POSIX setenv() takes three arguments, your patch passes only two.
Your patch doesn't check the value returned by setenv() or putenv().

Regards,
m


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk