Inspect socket credentials only when the structures are defined

Specifically, on macOS, while `SCM_CREDS` is defined, the definition
of `struct cmsgcred` is disabled.
This commit is contained in:
Nobuyoshi Nakada 2026-07-21 17:23:43 +09:00
parent fda83cd2d6
commit 403200c900
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2026-07-21 09:26:33 +00:00

View File

@ -706,8 +706,14 @@ anc_inspect_passcred_credentials(int level, int type, VALUE data, VALUE ret)
}
#endif
#if defined(SCM_CREDS)
#define INSPECT_SCM_CREDS
#if !defined(SCM_CREDS)
#elif defined(HAVE_TYPE_STRUCT_CMSGCRED) /* FreeBSD */
# define INSPECT_SCM_CREDS
#elif defined(HAVE_TYPE_STRUCT_SOCKCRED) /* FreeBSD, NetBSD */
# define INSPECT_SCM_CREDS
#endif
#ifdef INSPECT_SCM_CREDS
static int
anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret)
{