From: Joel Rosdahl Date: Sun, 24 May 2020 09:25:06 +0000 (+0200) Subject: Convert last usage of putenv X-Git-Tag: v4.0~432 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2f61bd4555254fa0edf3f5980f3b9406ed68496;p=thirdparty%2Fccache.git Convert last usage of putenv --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 846e23b76..eb15808c5 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -1899,12 +1899,7 @@ set_up_uncached_err() failed(STATS_ERROR); } - // Leak a pointer to the environment. - char* buf = format("UNCACHED_ERR_FD=%d", uncached_fd); - if (putenv(buf) == -1) { - cc_log("putenv failed: %s", strerror(errno)); - failed(STATS_ERROR); - } + x_setenv("UNCACHED_ERR_FD", fmt::format("{}", uncached_fd).c_str()); } static void