| 1834 | } |
| 1835 | |
| 1836 | Status SetEnvVar(std::string_view name, std::string_view value) { |
| 1837 | #ifdef _WIN32 |
| 1838 | if (SetEnvironmentVariableA(name.data(), value.data())) { |
| 1839 | return Status::OK(); |
| 1840 | } else { |
| 1841 | return Status::Invalid("failed setting environment variable"); |
| 1842 | } |
| 1843 | #else |
| 1844 | if (setenv(name.data(), value.data(), 1) == 0) { |
| 1845 | return Status::OK(); |
| 1846 | } else { |
| 1847 | return Status::Invalid("failed setting environment variable"); |
| 1848 | } |
| 1849 | #endif |
| 1850 | } |
| 1851 | |
| 1852 | Status DelEnvVar(std::string_view name) { |
| 1853 | #ifdef _WIN32 |