storage/Plugin: return std::unique_ptr<Storage>

This commit is contained in:
Max Kellermann
2018-01-02 16:11:17 +01:00
parent 3f4f7b0a53
commit 3c5e4e2788
15 changed files with 46 additions and 32 deletions

View File

@@ -179,7 +179,7 @@ SmbclientDirectoryReader::GetInfo(gcc_unused bool follow)
return ::GetInfo(path.c_str());
}
static Storage *
static std::unique_ptr<Storage>
CreateSmbclientStorageURI(gcc_unused EventLoop &event_loop, const char *base)
{
if (strncmp(base, "smb://", 6) != 0)
@@ -198,7 +198,7 @@ CreateSmbclientStorageURI(gcc_unused EventLoop &event_loop, const char *base)
throw MakeErrno("smbc_new_context() failed");
}
return new SmbclientStorage(base, ctx2);
return std::make_unique<SmbclientStorage>(base, ctx2);
}
const StoragePlugin smbclient_storage_plugin = {