2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[4062] copy_ -> env_copy_

This commit is contained in:
Francis Dupont
2015-09-25 18:51:00 +02:00
parent 5853bacc9b
commit 38f3d27792

View File

@@ -57,11 +57,11 @@ namespace {
class DaemonTest : public ::testing::Test {
public:
/// @brief Constructor
DaemonTest() : env_(0), copy_() {
DaemonTest() : env_(0), env_copy_() {
// Take a copy of KEA_PIDFILE_DIR environment variable value
env_ = getenv("KEA_PIDFILE_DIR");
if (env_) {
copy_ = std::string(env_);
env_copy_ = std::string(env_);
}
}
@@ -74,8 +74,8 @@ public:
isc::log::setDefaultLoggingOutput();
// Restore KEA_PIDFILE_DIR environment variable value
env_ = getenv("KEA_PIDFILE_DIR");
if (!copy_.empty() && (!env_ || !copy_.compare(env_))) {
setenv("KEA_PIDFILE_DIR", copy_.c_str(), 1);
if (!env_copy_.empty() && (!env_ || !env_copy_.compare(env_))) {
setenv("KEA_PIDFILE_DIR", env_copy_.c_str(), 1);
}
}
@@ -84,7 +84,7 @@ private:
char* env_;
/// @brief copy of KEA_PIDFILE_DIR environment variable value
std::string copy_;
std::string env_copy_;
};