lib/nfs/Connection: pass std::exception_ptr by value

This commit is contained in:
Max Kellermann 2024-05-06 17:02:59 +02:00
parent 2b0275a1c8
commit f5127686fe
3 changed files with 7 additions and 7 deletions

View File

@ -589,7 +589,7 @@ NfsConnection::BroadcastMountSuccess() noexcept
}
void
NfsConnection::BroadcastMountError(std::exception_ptr &&e) noexcept
NfsConnection::BroadcastMountError(std::exception_ptr e) noexcept
{
assert(GetEventLoop().IsInside());
@ -603,7 +603,7 @@ NfsConnection::BroadcastMountError(std::exception_ptr &&e) noexcept
}
void
NfsConnection::BroadcastError(std::exception_ptr &&e) noexcept
NfsConnection::BroadcastError(std::exception_ptr e) noexcept
{
assert(GetEventLoop().IsInside());

View File

@ -186,7 +186,7 @@ public:
void CancelAndClose(struct nfsfh *fh, NfsCallback &callback) noexcept;
protected:
virtual void OnNfsConnectionError(std::exception_ptr &&e) noexcept = 0;
virtual void OnNfsConnectionError(std::exception_ptr e) noexcept = 0;
private:
void DestroyContext() noexcept;
@ -203,8 +203,8 @@ private:
void MountInternal();
void BroadcastMountSuccess() noexcept;
void BroadcastMountError(std::exception_ptr &&e) noexcept;
void BroadcastError(std::exception_ptr &&e) noexcept;
void BroadcastMountError(std::exception_ptr e) noexcept;
void BroadcastError(std::exception_ptr e) noexcept;
static void MountCallback(int status, nfs_context *nfs, void *data,
void *private_data) noexcept;

View File

@ -27,11 +27,11 @@ public:
protected:
/* virtual methods from NfsConnection */
void OnNfsConnectionError(std::exception_ptr &&e) noexcept override;
void OnNfsConnectionError(std::exception_ptr e) noexcept override;
};
void
NfsManager::ManagedConnection::OnNfsConnectionError(std::exception_ptr &&e) noexcept
NfsManager::ManagedConnection::OnNfsConnectionError(std::exception_ptr e) noexcept
{
FmtError(nfs_domain, "NFS error on '{}:{}': {}",
GetServer(), GetExportName(), e);