Merge pull request #102 from ahmedyarub/ay/emscripten_support

Use secure_getenv() when building using Emscripten
This commit is contained in:
Kubernetes Prow Robot
2022-01-17 17:02:21 -08:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -47,7 +47,7 @@ static int setBasePathInCluster(char **pBasePath)
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
const char *service_host_env = getenv(SERVICE_HOST_ENV_NAME); const char *service_host_env = getenv(SERVICE_HOST_ENV_NAME);
#elif __linux #elif __linux || defined(__EMSCRIPTEN__)
const char *service_host_env = secure_getenv(SERVICE_HOST_ENV_NAME); const char *service_host_env = secure_getenv(SERVICE_HOST_ENV_NAME);
#endif #endif
if (!service_host_env) { if (!service_host_env) {
@@ -56,7 +56,7 @@ static int setBasePathInCluster(char **pBasePath)
} }
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
const char *service_port_env = getenv(SERVICE_PORT_ENV_NAME); const char *service_port_env = getenv(SERVICE_PORT_ENV_NAME);
#elif __linux #elif __linux || defined(__EMSCRIPTEN__)
const char *service_port_env = secure_getenv(SERVICE_PORT_ENV_NAME); const char *service_port_env = secure_getenv(SERVICE_PORT_ENV_NAME);
#endif #endif
if (!service_port_env) { if (!service_port_env) {

View File

@@ -113,7 +113,7 @@ static char *getWorkingConfigFile(const char *configFileNamePassedIn)
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
kubeconfig_env = getenv(ENV_KUBECONFIG); kubeconfig_env = getenv(ENV_KUBECONFIG);
#elif __linux #elif __linux || defined(__EMSCRIPTEN__)
kubeconfig_env = secure_getenv(ENV_KUBECONFIG); kubeconfig_env = secure_getenv(ENV_KUBECONFIG);
#endif #endif
if (kubeconfig_env) { if (kubeconfig_env) {
@@ -121,7 +121,7 @@ static char *getWorkingConfigFile(const char *configFileNamePassedIn)
} else { } else {
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
homedir_env = getenv(ENV_HOME); homedir_env = getenv(ENV_HOME);
#elif __linux #elif __linux || defined(__EMSCRIPTEN__)
homedir_env = secure_getenv(ENV_HOME); homedir_env = secure_getenv(ENV_HOME);
#else #else
#endif #endif