io/FileDescriptor: add [[nodiscard]]

This commit is contained in:
Max Kellermann
2024-01-11 16:59:44 +01:00
committed by Max Kellermann
parent 3e862b85d4
commit b63a794fbe
4 changed files with 31 additions and 4 deletions

View File

@@ -97,8 +97,7 @@ OssMixer::Close() noexcept
void
OssMixer::Open()
{
device_fd.OpenReadOnly(device);
if (!device_fd.IsDefined())
if (!device_fd.OpenReadOnly(device))
throw FmtErrno("failed to open {}", device);
try {