Swap #if blocks in uid.c so target platform gets checked before host

This avoids the case where a UEFI build on FreeBSD tries to call the system
issetugid function instead of returning 0 as it should do.

CLA: trivial

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from #9158)
This commit is contained in:
Rebecca Cran 2019-06-18 13:02:32 +10:00 committed by Pauli
parent 2be8c56a39
commit e24bdcde5a

View file

@ -10,7 +10,14 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/opensslconf.h> #include <openssl/opensslconf.h>
#if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ > 2) || defined(__DragonFly__) #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
int OPENSSL_issetugid(void)
{
return 0;
}
#elif defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ > 2) || defined(__DragonFly__)
# include OPENSSL_UNISTD # include OPENSSL_UNISTD
@ -19,13 +26,6 @@ int OPENSSL_issetugid(void)
return issetugid(); return issetugid();
} }
#elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
int OPENSSL_issetugid(void)
{
return 0;
}
#else #else
# include OPENSSL_UNISTD # include OPENSSL_UNISTD