From 7409adbff349f8ea019213e7786dd9a2cce92148 Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Tue, 23 Jun 2020 10:01:22 -0400 Subject: [PATCH] Make kMaxSendRecvMsgFDs constexpr-accessible in external contexts Change-Id: I474186f30f38fb61e656315ebcbdc72d6b107d4e Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2259333 Commit-Queue: Eric Astor Reviewed-by: Mark Mentovai --- util/linux/socket.cc | 4 ++-- util/linux/socket.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/linux/socket.cc b/util/linux/socket.cc index f2ad9bd0..868cee4a 100644 --- a/util/linux/socket.cc +++ b/util/linux/socket.cc @@ -23,6 +23,8 @@ namespace crashpad { +constexpr size_t UnixCredentialSocket::kMaxSendRecvMsgFDs; + // static bool UnixCredentialSocket::CreateCredentialSocketpair(ScopedFileHandle* sock1, ScopedFileHandle* sock2) { @@ -49,8 +51,6 @@ bool UnixCredentialSocket::CreateCredentialSocketpair(ScopedFileHandle* sock1, return true; } -constexpr size_t UnixCredentialSocket::kMaxSendRecvMsgFDs = 4; - // static int UnixCredentialSocket::SendMsg(int fd, const void* buf, diff --git a/util/linux/socket.h b/util/linux/socket.h index 85860f7b..d762592b 100644 --- a/util/linux/socket.h +++ b/util/linux/socket.h @@ -40,7 +40,7 @@ class UnixCredentialSocket { //! \brief The maximum number of file descriptors that may be sent/received //! with `SendMsg()` or `RecvMsg()`. - static const size_t kMaxSendRecvMsgFDs; + static constexpr size_t kMaxSendRecvMsgFDs = 4; //! \brief Wraps `sendmsg()` to send a message with file descriptors. //!