language-extensions/R/src/linux/Utilities_linux.cpp
//--------------------------------------------------------------------------------------------------
// Name: Utilities::SetEnvVariable
//
// Description:
//  Sets the environment variable name to the specified value
//
// Returns:
//  Returns the result of the putenv operation. 0 indicates success, nonzero indicates error.
//
:SetEnvVariable
Description:
Sets the environment variable name to the specified value

Returns the result of the putenv operation. 0 indicates success, nonzero indicates error.
: SetEnvVariable Description : Sets the environment variable name to the specified value Returns the result of the putenv operation . 0 indicates success nonzero indicates error .
int Utilities::SetEnvVariable(const string &envVarName, const string &value)
{
	errno = 0;
	string keyValue = string(envVarName + "=" + value);
	int result = putenv(const_cast<char*>(keyValue.c_str()));
	if (result != 0)
	{
		LOG_ERROR("Failed to set the value " + value +
			" to the environment variable " + envVarName +
			" with system error #" + to_string(errno) + ".");
	}
	return result;
}
int Utilities :: SetEnvVariable ( const string & envVarName , const string & value ) { errno = 0 ; string keyValue = string ( envVarName + " " + value ) ; int result = putenv ( const_cast < char * > ( keyValue . c_str ( ) ) ) ; if ( result != 0 ) { LOG_ERROR ( " " + value + " " + envVarName + " " + to_string ( errno ) + " " ) ; } return result ; }
Name: Utilities::SetEnvVariable
Description:
Sets the environment variable name to the specified value
Name : Utilities :: SetEnvVariable Description : Sets the environment variable name to the specified value