summaryrefslogtreecommitdiff
path: root/src/mongo/transport/service_executor_utils.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2022-04-28 07:39:29 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-28 08:28:54 +0000
commit5b17ba836945f2b7cbcc77a643311f41fe7b7b6e (patch)
tree11aa849763d123d755eb0d9c30215904acdef4c2 /src/mongo/transport/service_executor_utils.cpp
parent30260c79d9e09dee6c68637f87db6c4bdf16cbfe (diff)
downloadmongo-5b17ba836945f2b7cbcc77a643311f41fe7b7b6e.tar.gz
SERVER-41353 replace errnoWithDescription with an API based on std::error_code
Diffstat (limited to 'src/mongo/transport/service_executor_utils.cpp')
-rw-r--r--src/mongo/transport/service_executor_utils.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/transport/service_executor_utils.cpp b/src/mongo/transport/service_executor_utils.cpp
index 43e505d7d71..7dcdb6cab8d 100644
--- a/src/mongo/transport/service_executor_utils.cpp
+++ b/src/mongo/transport/service_executor_utils.cpp
@@ -86,11 +86,10 @@ Status launchServiceWorkerThread(unique_function<void()> task) noexcept {
if (limits.rlim_cur >= kStackSize) {
int failed = pthread_attr_setstacksize(&attrs, kStackSize);
if (failed) {
- const auto ewd = errnoWithDescription(failed);
LOGV2_WARNING(22949,
"pthread_attr_setstacksize failed: {error}",
"pthread_attr_setstacksize failed",
- "error"_attr = ewd);
+ "error"_attr = errorMessage(posixError(failed)));
}
} else if (limits.rlim_cur < kStackSize) {
LOGV2_WARNING(22950,
@@ -116,17 +115,17 @@ Status launchServiceWorkerThread(unique_function<void()> task) noexcept {
{logv2::UserAssertAfterLog()},
"pthread_create failed: error: {error}",
"pthread_create failed",
- "error"_attr = errnoWithDescription(failed));
+ "error"_attr = errorMessage(posixError(failed)));
} else if (failed < 0) {
- auto savedErrno = errno;
+ auto ec = lastPosixError();
LOGV2_ERROR_OPTIONS(4850901,
{logv2::UserAssertAfterLog()},
"pthread_create failed with a negative return code: {code}, errno: "
"{errno}, error: {error}",
"pthread_create failed with a negative return code",
"code"_attr = failed,
- "errno"_attr = savedErrno,
- "error"_attr = errnoWithDescription(savedErrno));
+ "errno"_attr = ec.value(),
+ "error"_attr = errorMessage(ec));
}
ctx.release();