Brad Bishop | 63ae878 | 2019-10-09 09:56:13 -0400 | [diff] [blame] | 1 | From 7d0732d69a774e28bc46b8b487d9f61bdd8afbff Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 6 Oct 2019 18:15:44 -0700 |
| 4 | Subject: [PATCH] os_posix: Use __FreeBSD__ to control secure_getenv definition |
| 5 | |
| 6 | __USE_GNU does not cover all Linux platforms, e.g. when using musl as C |
| 7 | library, __USE_GNU may not be defined but it does provide secure_getenv |
| 8 | so instead of narrowing the else condition, lets speicifically check for |
| 9 | FreeBSD being the platform, since that seems to be the intention here |
| 10 | anyway |
| 11 | |
| 12 | Upstream-Status: Submitted [https://github.com/pmem/pmdk/pull/3999] |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | src/common/os_posix.c | 2 +- |
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/src/common/os_posix.c b/src/common/os_posix.c |
| 19 | index a9a37ef84..052db2383 100644 |
| 20 | --- a/src/common/os_posix.c |
| 21 | +++ b/src/common/os_posix.c |
| 22 | @@ -346,7 +346,7 @@ os_setenv(const char *name, const char *value, int overwrite) |
| 23 | /* |
| 24 | * secure_getenv -- provide GNU secure_getenv for FreeBSD |
| 25 | */ |
| 26 | -#ifndef __USE_GNU |
| 27 | +#if defined(__FreeBSD__) |
| 28 | static char * |
| 29 | secure_getenv(const char *name) |
| 30 | { |
| 31 | -- |
| 32 | 2.23.0 |
| 33 | |