Adding linux specific env implementation.
diff --git a/Makefile b/Makefile
index 7f4c7dc..2447aeb 100644
--- a/Makefile
+++ b/Makefile
@@ -1216,6 +1216,7 @@
src/core/support/cmdline.c \
src/core/support/cpu_linux.c \
src/core/support/cpu_posix.c \
+ src/core/support/env_linux.c \
src/core/support/env_posix.c \
src/core/support/env_win32.c \
src/core/support/file.c \
@@ -1310,6 +1311,7 @@
objs/$(CONFIG)/src/core/support/cmdline.o:
objs/$(CONFIG)/src/core/support/cpu_linux.o:
objs/$(CONFIG)/src/core/support/cpu_posix.o:
+objs/$(CONFIG)/src/core/support/env_linux.o:
objs/$(CONFIG)/src/core/support/env_posix.o:
objs/$(CONFIG)/src/core/support/env_win32.o:
objs/$(CONFIG)/src/core/support/file.o:
diff --git a/build.json b/build.json
index ea75e42..704c1bd 100644
--- a/build.json
+++ b/build.json
@@ -241,6 +241,7 @@
"src/core/support/cmdline.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
+ "src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
"src/core/support/file.c",
diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h
index 4ffadde..e99099c 100644
--- a/include/grpc/support/port_platform.h
+++ b/include/grpc/support/port_platform.h
@@ -76,7 +76,7 @@
#define GPR_LINUX_EVENTFD 1
#define GPR_POSIX_SOCKET 1
#define GPR_POSIX_SOCKETADDR 1
-#define GPR_POSIX_ENV 1
+#define GPR_LINUX_ENV 1
#define GPR_POSIX_FILE 1
#define GPR_POSIX_STRING 1
#define GPR_POSIX_SYNC 1
diff --git a/src/core/support/env_posix.c b/src/core/support/env_posix.c
index 79b8fcd..bcbff9a 100644
--- a/src/core/support/env_posix.c
+++ b/src/core/support/env_posix.c
@@ -31,11 +31,6 @@
*
*/
-/* for secure_getenv. */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
#include <grpc/support/port_platform.h>
#ifdef GPR_POSIX_ENV
@@ -49,7 +44,7 @@
#include "src/core/support/string.h"
char *gpr_getenv(const char *name) {
- char *result = secure_getenv(name);
+ char *result = getenv(name);
return result == NULL ? result : gpr_strdup(result);
}
diff --git a/vsprojects/vs2013/gpr.vcxproj b/vsprojects/vs2013/gpr.vcxproj
index da8ab6b..3cbbfc2 100644
--- a/vsprojects/vs2013/gpr.vcxproj
+++ b/vsprojects/vs2013/gpr.vcxproj
@@ -117,6 +117,8 @@
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\support\env_linux.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\support\env_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_win32.c">
diff --git a/vsprojects/vs2013/gpr.vcxproj.filters b/vsprojects/vs2013/gpr.vcxproj.filters
index 72b620a..eb79b8d 100644
--- a/vsprojects/vs2013/gpr.vcxproj.filters
+++ b/vsprojects/vs2013/gpr.vcxproj.filters
@@ -16,6 +16,9 @@
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\support\env_linux.c">
+ <Filter>src\core\support</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\support\env_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>